Philipp Pagel <p.pagel <at> wzw.tum.de> writes: [...] > > foo$bar <- factor(foo$bar)
This was my first attemot, before posting here, and it somehow did not worked... ...now it works.... so I maybe was too tired, when trying it and messed something up. :( [...] > > x <- factor(c(0,1,3,4,5,7)) > > x > [1] 0 1 3 4 5 7 > Levels: 0 1 3 4 5 7 > > as.numeric(x) > [1] 1 2 3 4 5 6 I know, and that's the reason why I first used as.vector() before passing the results to as.numeric(). Without as.vector() one get's the int-representation of the factors, and not the values of the column. Ciao, Oliver ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.