These questions will be designed to assess the ability of people to get data into R from .txt or .csv files and distinguish novice from expert. The second question would give away the answer to the first potentially, so I would use them in-class with clickers sequentially or online without the option to go back to the previous question.
- Which of the following commands will import data from a text file into R?
- import(“Data_File.txt”)
- read.table(“Data_File.txt”)
- open(“Data_File.txt”)
- import.data(“Data_File.txt”)
- Which of the following will import a csv file where the first row is a list of the variable names and save it as a dataframe (data1)?
- data1 = Read.Csv(“Data_File.csv”, header = TRUE)
- data1 = read.csv(“Data_File.csv”, row1 = TRUE, sep = “,”)
- data1 = read.table(“Data_File.csv”, header = TRUE, sep = csv)
- data1 = read.table(“Data_File.csv”, header = TRUE, sep = “,”)