Skip to content

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:
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