[R] Help with character columns in a table
Roger D. Peng
rpeng at jhsph.edu
Wed Apr 7 17:30:07 CEST 2004
You could set `as.is = TRUE' when running read.table(), as the help
page says.
-roger
Rory Campbell-Lange wrote:
> I have done a read.table on a data file with the aim of extracting
> subsets of the data eg
>
> table[table$desc = 'result1',]
>
> How can I convert $desc to a character type? At present it is seen by
> typeof() as an integer.
>
> How can I do the equivalent of
>
> table[table$desc = 'result1' && table$amt > 20, ]
>
> Thanks,
> Rory
>
More information about the R-help
mailing list