Re: [R] creating additional column

2011-03-11 Thread Laszlo
Thank you Philipp, it is very useful! How come I haven't figured it out myself I dont know... Have a pleasant weekend! Laszlo -- View this message in context: http://r.789695.n4.nabble.com/creating-additional-column-tp3341224p3348552.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] creating additional column

2011-03-08 Thread Philipp Pagel
Hi! max.col does what you want. Example: > dat <- data.frame(a=rnorm(20),b=rnorm(20),c=rnorm(20)) > dat a b c 1 1.17910304 -0.56951219 -0.2243664 2 -1.43840866 -0.99013855 -0.1613536 3 1.08515152 -0.77975274 0.3734530 4 -0.92154605 -0.20318367 0.1