John Sorkin
2009-Aug-14 14:44 UTC
[R] creating list of the from 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, . . ., n, n, n?
Windows XP R 2.8.1 Is there any way to make a list of the from 1,1,1,2,2,2,3,3,3,4,4,4, . . ., n,n,n? Thanks John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) Confidentiality Statement: This email message, including any attachments, is for th...{{dropped:6}}
jim holtman
2009-Aug-14 14:49 UTC
[R] creating list of the from 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, . . ., n, n, n?
> rep(1:4, each=3)[1] 1 1 1 2 2 2 3 3 3 4 4 4 On Fri, Aug 14, 2009 at 10:44 AM, John Sorkin<jsorkin at grecc.umaryland.edu> wrote:> Windows XP > R 2.8.1 > > Is there any way to make a list of the from > ?1,1,1,2,2,2,3,3,3,4,4,4, . . ., n,n,n? > Thanks > John > > John David Sorkin M.D., Ph.D. > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > > Confidentiality Statement: > This email message, including any attachments, is for ...{{dropped:19}}
Steve Lianoglou
2009-Aug-14 14:53 UTC
[R] creating list of the from 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, . . ., n, n, n?
Hi, On Aug 14, 2009, at 10:44 AM, John Sorkin wrote:> Windows XP > R 2.8.1 > > Is there any way to make a list of the from > 1,1,1,2,2,2,3,3,3,4,4,4, . . ., n,n,n?Like so? R> rep(1:10, each=3) [1] 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 [26] 9 9 10 10 10 -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact