Assessing expertise of getting data into R

Nov 4, 2013 • Daniel Hocking

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.

 

  1. Which of the following commands will import data from a text file into R?
  1. import(“Data_File.txt”)
  2. read.table(“Data_File.txt”)
  3. open(“Data_File.txt”)
  4. import.data(“Data_File.txt”)

 

  1. 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)?
  1. data1 = Read.Csv(“Data_File.csv”, header = TRUE)
  2. data1 = read.csv(“Data_File.csv”, row1 = TRUE, sep = “,”)
  3. data1 = read.table(“Data_File.csv”, header = TRUE, sep = csv)
  4. data1 = read.table(“Data_File.csv”, header = TRUE, sep = “,”)