Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
99 views1 page

Economics: Tutorial 6 - Data Import

This document provides instructions for writing R programs to import various types of data. The programs should: 1) access built-in R datasets; 2) read a locally saved text file; 3) read data from a CSV file located online; 4) read data from the third sheet of an online Excel file; and 5) download an online SQLite database, connect to it, and retrieve data from one of its tables.

Uploaded by

hdsasdad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views1 page

Economics: Tutorial 6 - Data Import

This document provides instructions for writing R programs to import various types of data. The programs should: 1) access built-in R datasets; 2) read a locally saved text file; 3) read data from a CSV file located online; 4) read data from the third sheet of an online Excel file; and 5) download an online SQLite database, connect to it, and retrieve data from one of its tables.

Uploaded by

hdsasdad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CT127-3-2 Programming for Data Analysis Data Import

Tutorial 6– Data Import

1. Write a program to access and print the following data set included in R:
a. AirPassengers in datasets package.
b. economics in ggplot2 package.

2. Create a text file manually and save the following content in it:
12000
7000
9000
6000
8000
Then, write a program read this file and print the minimum, maximum, and average values.

3. Write an R program to read the content of a CSV file located in the following link
http://www.jaredlander.com/data/TomatoFirst.csv . Then, use the obtained data to achieve the following
tasks:
a. Return how many rows and columns in this file.
b. Return the details of the least Sweet tomato type.
c. Return the summation of prices when the Source is “Whole Foods”.

4. Write an R program to read the content of third sheet in an excel file located in the following link
http://www.jaredlander.com/data/ExcelExample.xlsx .

5. Write an R program to download an SQLite database located in the following link


http://www.jaredlander.com/data/diamonds.db . Then, do the following tasks:
a. Connect to this dataset. Then list the tables in this dataset and the fields in each table.
b. Retrieve all the elements of all the rows of diamonds table.

Level-2 Asia Pacific University of Technology and Innovation Page 1 of 1

You might also like