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