unique(liste[[var]])  will work...
  ----- Original Message ----- 
  From: Philippe Hupé 
  Cc: r-help@stat.math.ethz.ch 
  Sent: Tuesday, May 20, 2003 8:34 PM
  Subject: [R] conversion of a list element to a vector


  Hello,

  I would like to extract unique elements of a variable which belongs to a 
  list

  liste <- list(V1=c(1,2,3,5,2), V2=c(1,2,3,4,5))
  var <- "V1"
  uni <- unique(liste[var]) #does not work

  I know that liste[var]$V1 works but for my problem, the label variable 
  "V1" is only know through the var variable.

  I can I do

  Thanks in advance.

  ______________________________________________
  R-help@stat.math.ethz.ch mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help


	[[alternate HTML version deleted]]


