[R] (no subject)

Jim Lemon drjimlemon at gmail.com
Wed Jan 20 01:21:29 CET 2016


Hi Maryam,
Sounds like:

c(Young.list1[sample(1:20,1),],Young.list2[sample(1:20,1),],Young.list3[sample(1:20,1),])

to me.

Jim


On Wed, Jan 20, 2016 at 7:35 AM, <ruipbarradas at sapo.pt> wrote:

> Hello,
>
> What do you want to sample? Rows? With or without replacement? You
> need to give us more information on what you want.
>
> Start by seeing the help page for ?sample
>
> Hope this helps,
>
> Rui Barradas
>
>
> Citando MARYAM <firoozi_maryam6858 at yahoo.com>:
>
> > Dear mr/madam
> > I have 3 matrix with 20 rows and 3 columns like this: I want to
> > sample randomly from three matrix and put it in a vector.How can i
> > do that?
> >
> > Young.list1<- matrix(NA,nrow= 20,ncol=3)
> > Young.list1[,1]<- 1:20
> > Young.list1[,2]<- 0.6
> > Young.list1[,3]<- 500
> > colnames(Young.list1)<- c("ID","r","EBV")
> > ###########################################
> > Young.list2<- matrix(NA,nrow= 20,ncol=3)
> > Young.list2[,1]<- 21:40
> > Young.list2[,2]<- 0.7
> > Young.list2[,3]<- 600
> > colnames(Young.list2)<- c("ID","r","EBV")
> > ###########################################
> > Young.list3<- matrix(NA,nrow= 20,ncol=3)
> > Young.list3[,1]<- 41:60
> > Young.list3[,2]<- 0.8
> > Young.list3[,3]<- 700
> > colnames(Young.list3)<- c("ID","r","EBV")
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.htmland provide commented,
> > minimal, self-contained, reproducible code.
>
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]



More information about the R-help mailing list