Colleagues, I want to create the following array: "A1", "A2", "A3", "B1", "B2", "B3", "C1", "C2", "C3" I recall that there is a trick using "c" or "paste" permitting me to form all combinations of c("A", "B", "C") and 1:3. But, I can't recall the trick. Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone: 1-866-PLessThan (1-866-753-7784) Fax: 1-415-564-2220 www.PLessThan.com [[alternative HTML version deleted]]
Hi, paste(rep(LETTERS[1:3], each=3), rep(1:3, 3), sep="") -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 04/09/07, Dennis Fisher <fisher@plessthan.com> wrote:> > Colleagues, > > I want to create the following array: > "A1", "A2", "A3", "B1", "B2", "B3", "C1", "C2", "C3" > > I recall that there is a trick using "c" or "paste" permitting me to > form all combinations of c("A", "B", "C") and 1:3. But, I can't > recall the trick. > > Dennis > > > Dennis Fisher MD > P < (The "P Less Than" Company) > Phone: 1-866-PLessThan (1-866-753-7784) > Fax: 1-415-564-2220 > www.PLessThan.com > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@stat.math.ethz.ch mailing list > 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]]
try this: paste(rep(LETTERS[1:3], each = 3), 1:3, sep = "") Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm Quoting Dennis Fisher <fisher at plessthan.com>:> Colleagues, > > I want to create the following array: > "A1", "A2", "A3", "B1", "B2", "B3", "C1", "C2", "C3" > > I recall that there is a trick using "c" or "paste" permitting me to > form all combinations of c("A", "B", "C") and 1:3. But, I can't > recall the trick. > > Dennis > > > Dennis Fisher MD > P < (The "P Less Than" Company) > Phone: 1-866-PLessThan (1-866-753-7784) > Fax: 1-415-564-2220 > www.PLessThan.com > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > 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. > >Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm