[R] Problem in 'Apply' function: does anybody have other solution

Carl Witthoft carl at witthoft.com
Fri Jun 19 00:05:06 CEST 2009


Several folks pointed out the problem is most likely that a column of 
data is being read in as a factor.

I prefer to solve this by setting as.is=TRUE as one of the arguments to 
read.table() (unless I am mis-remembering and it needs to be set to 
FALSE :-) ).  The point is to tell the read function to read character 
strings in as character strings, rather than converting them into factors.
After that you can convert the offending column with as.numeric or one 
of the date-conversion functions (if the input is date/time strings)

Carl




More information about the R-help mailing list