read.csv
Imported a csv-dataset to R but the values becomes factors
Both the data import function (here: read.csv()) as well as a global option offer you to say stringsAsFactors=FALSE which should fix this.
Why am I getting X. in my column names when reading a data frame?
read.csv() is a wrapper around the more general read.table() function. That latter function has argument check.names which is documented as: check.names: logical. If ‘TRUE’ then the names of the variables in the data frame are checked to ensure that they are syntactically valid variable names. If necessary they are adjusted (by ‘make.names’) so that they … Read more
Is there a way to use read.csv to read from a string value rather than a file in R?
Editing a 7-year old answer: By now, this is much simpler thanks to the text= argument which has been added to read.csv() and alike: R> data <- read.csv(text=”flim,flam + 1.2,2.2 + 77.1,3.14″) R> data flim flam 1 1.2 2.20 2 77.1 3.14 R> Yes, look at the help for textConnection() — the very powerful notion … Read more