Caitlin Sadowski wrote:
I have a large csv table I am trying to read into R. I would like each
column to be of type factor. However, most columns have only numeral
entries (e.g. likert scales), so are automatically imported as type
numeric. Is there a way to convert ALL columns to be of type factor,
without having to convert each column manually?

It's in the help file for ?read.csv, the colClasses argument:

colClasses: character.  A vector of classes to be assumed for the
          columns.  Recycled as necessary, or if the character vector
          is named, unspecified values are taken to be ‘NA’.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to