[R] read.table and column class

Johannes Graumann johannes_graumann at web.de
Tue Apr 15 11:10:10 CEST 2008


Hi,
I read in some tabular data using this:

> read.table(file, quote = "\"", header = TRUE, sep = "\t", 
>       stringsAsFactors > = FALSE, comment.char = "")

One slight problem I have now is that some columns in the data set contain
either "" or "+", which means FALSE or TRUE respectively. The command
results in those columns being numeric with "NA" corresponding to the empty
case and "0" to the "+"-case. Is there any smart way of making read table
rendering these columns boolean to start with?

Thanks for any insight, Joh



More information about the R-help mailing list