Skip to content
Prev 298982 / 398506 Next

subset data based on values in multiple columns

Hi
two
not
this:
("2012-01-25","2012-01-25","2012-01-26","2012-01-27","2012-01-27","2012-01-27")))
for
appreciated!!

Just few days ago similarquestion was asked (selecting rows by maximum 
value of one variables in dataframe nested by another Variable). Here is 
what was recommended.

do.call("rbind",lapply(split(data, data$date), function(x) 
x[which.max(x[,2]),]))

Regards
Petr
http://www.R-project.org/posting-guide.html
Message-ID: <OFF895DBAC.E5E5112B-ONC1257A30.00275AC6-C1257A30.0027C7FD@precheza.cz>
In-Reply-To: <C88DD2E5A335544E830AB0D8E75B3AB8166F2423@HKNPRD0210MB362.apcprd02.prod.outlook.com>