[R] levels of an array (strings and numbers)

From: Alessandro Antonucci <alessandro_at_idsia.ch>
Date: Fri 04 Aug 2006 - 02:11:04 EST

Reading a csv file (db.csv) as:


I can use the command 'levels' to extract the different values appearing for each
column as follows:

> d<-read.csv("db.csv")
> levels(d[,2])

which returns

> [1] "empty" "full"

while, doing the same with a numerical csv file as:


the same instruction returns an empty output instead of 6 7

Any idea about that?

Thanks in advance,

Alessandro Antonucci
Dalle Molle Institute for Artificial Intelligence (IDSIA)
at Idsia			e-mail: alessandro@idsia.ch
Galleria 2			web:   idsia.ch/~alessandro
Via Cantonale			mobile:   +39 339-567-23-28
CH-6928				tel:       +41 58-666-66-70
Manno - Lugano			fax:       +41 58-666-66-61
Switzerland			skype: alessandro.antonucci

R-help@stat.math.ethz.ch mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri Aug 04 02:16:23 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 04 Aug 2006 - 04:17:58 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.