When using colClasses you need to specify the types of all the columns. So assuming the other columns are numeric data, you could set

colClasses = c("character", "numeric", "character", "numeric", "numeric")

-roger

Kalaylioglu, Zeynep (IMS) wrote:
Hi
I am trying to read a data frame from a text editor in to R. I want some
of the columns to be read in as "character" not numeric.
I figured that I can do that by using "colClasses" in "read.table"
command. However, I couldn't find out how to use "colClasses". e.g. say I have 5 column in the data file. I want 1st and
3rd column to be read in as character. How can I define
this using colClasses? (or is there a better way to do what I want?)
Thanks.
Zeynep


        [[alternative HTML version deleted]]

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to