An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090314/9bf75b99/attachment.pl>
help to obtain the list of the ID
3 messages · gianni lavaredo, Torleif Markussen Lunde, Paul Hiemstra
Hi try unique(mfDF$ID) Best wishes Torleif ________________________________ Fra: r-sig-geo-bounces at stat.math.ethz.ch p? vegne av gianni lavaredo Sendt: l? 14.03.2009 18:52 Til: r-sig-geo at stat.math.ethz.ch Emne: [R-sig-Geo] help to obtain the list of the ID Thanks in advice for your time, Sorry for this simple question I am searching a function or a method to obtain the list of the ID. I tryed sever combination like manual or in R wiki mfDF <- data.frame( ID =c(1,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,3), value =c(2,12,25,50,100,200,6,12,50,25,50,50,6,8,90,5,8)) like this
1 2 3 Thanks and sorry Gianni _______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
gianni lavaredo schreef:
Thanks in advice for your time, Sorry for this simple question I am searching a function or a method to obtain the list of the ID. I tryed sever combination like manual or in R wiki mfDF <- data.frame( ID =c(1,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,3), value =c(2,12,25,50,100,200,6,12,50,25,50,50,6,8,90,5,8)) like this 1 2 3 Thanks and sorry Gianni [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Hi, Because ID is a categorical value, it is good to make it a factor (R type for categories). Then it is also quite easy to get the levels: mfDF <- data.frame( ID =as.factor(c(1,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,3)), value =c(2,12,25,50,100,200,6,12,50,25,50,50,6,8,90,5,8)) # Get a list of the possible ID's levels(mfDF$ID) cheers, Paul
Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~paul