Displaying 1 result from an estimated 1 matches for "splitmembership".
2010 Oct 04
1
Splitting a DF into rows according to a column
...strsplit(loremIpsum,"
")),length.out=510),Column2=runif(510,min=0,max=1e8))
is to be split into DFs with 50 entries in an ordered manner according to
column2 (first DF ist o contain the rows with the 50 largest numbers, ...).
Here is what I have been doing:
> binSize <- 50
> splitMembership <-
pmin(ceiling(order(tmpDF[["Column2"]],decreasing=TRUE)/binSize),floor(nrow(tmpDF)/binSize))
> splitList <- split(tmpDF,splitMembership)
Distribution seems to work ...
> sapply(splitList,nrow)
But this is NOT what I wanted ...
> sapply(splitList,function(x){max(x[[&quo...