Re: [R] random sample from arrays

2010-07-12 Thread Assa Yeroslaviz
Hi Joris, sorry for the late response. But I was away for a couple of days. Apparently i also did something wrong than. Now both these loops are working as they suppose to. Thanks again for all the help. Assa On Fri, Jul 9, 2010 at 17:05, Joris Meys wrote: > Could you elaborate? > > Both > >

Re: [R] random sample from arrays

2010-07-09 Thread Joris Meys
Could you elaborate? Both x <- 1:4 set <- matrix(nrow = 50, ncol = 11) for(i in c(1:11)){ set[,i] <-sample(x,50) print(c(i,"->", set), quote = FALSE) } and x <- 1:4 set <- matrix(nrow = 50, ncol = 11) for(i in c(1:50)){ set[i,] <-sample(x,11) print(c(i,"->", set)

Re: [R] random sample from arrays

2010-07-09 Thread Assa Yeroslaviz
Hi Joris, I guess i did it wrong again. but your example didn't work either. I still get the error massage. but replicate function just fine. I can even replicate the whole array lines. THX Assa On Thu, Jul 8, 2010 at 15:20, Joris Meys wrote: > Don't know what exactly you're trying to do, but

Re: [R] random sample from arrays

2010-07-08 Thread David Winsemius
On Jul 8, 2010, at 2:04 AM, Assa Yeroslaviz wrote: Hello R users, I'm trying to extract random samples from a big array I have. I have a data frame of over 40k lines and would like to produce around 50 random sample of around 200 lines each from this array. this is the matrix ID

Re: [R] random sample from arrays

2010-07-08 Thread Joris Meys
Don't know what exactly you're trying to do, but you make a matrix with 11 columns and 50 rows, then treat it as a vector. On top of that, you try to fill 50 rows/columns with 50 values. Off course that doesn't work. Did you check the warning messages when running the code? Either do : for(i in

[R] random sample from arrays

2010-07-07 Thread Assa Yeroslaviz
Hello R users, I'm trying to extract random samples from a big array I have. I have a data frame of over 40k lines and would like to produce around 50 random sample of around 200 lines each from this array. this is the matrix ID xxx_1c xxx__2c xxx__3c xxx__4c xxx__5T xxx__6T xxx__7T xx