How do I pull a CSV file into R and keep my names and labels?

Viewed 26

I am trying to pull in a CSV file exported from Qualtrics. When I read in my file, it captures the variable name (first row) but my labels are in row 2. How do I read in row 2 as a label and not as my first data line?

I tried this :

filename<-read.csv(filename.csv, header = true)
varNames<-read.csv(t1, nrows=1, stringsAsFactors= FALSE, header=FALSE)
varLabels<-read.csv(t1, nrows=1, stringsAsFactors = FALSE, header=TRUE)

but I keep getting an error like this:

Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
'file' must be a character string or connection

how do I fix this?

0 Answers
Related