## recreating your data
mydata<-list(matrix(1:9, nrow=3, byrow=T),
matrix(10:15, nrow=2, byrow=T),
matrix(16:30, nrow=5, byrow=T))
## get the shortest matrix in your list
n <- min(unlist(lapply(mydata, nrow)))
## subset the list into random samples of length n
??
Something like:
lapply(mydata, function(x){
nr <- nrow(x)
x[sample(seq_len(nr),nr,rep=TRUE),]
})
maybe. The idea is to use the sampled rows as your row index.
-- Bert
On Mon, Apr 2, 2012 at 11:24 AM, Bcampbell99 wrote:
> Hi:
>
> I'm sure this seems like a rudimentary question, but I am n
2 matches
Mail list logo