have a look at function paste(), e.g.,

Dat <- data.frame(A = c("aaa", "bbb", "ccc", "ddd"),
    B = c(111, 222, 333, 444))

Dat$C <- paste(Dat$A, Dat$B, sep = ".")
Dat


I hope it helps.

Best,
Dimitris


On 11/30/2010 9:30 AM, alcesgabbo wrote:

I have a table like this:


A           B
aaa       111
bbb       222
ccc       333
ddd       444

and I would like a new row C:

A           B           C
aaa       111      aaa.111
bbb       222      bbb.222
ccc       333      ccc.333
ddd       444      ddd.444


How can I do this
???

Thanks
Alberto


--
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center

Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014
Web: http://www.erasmusmc.nl/biostatistiek/

______________________________________________
R-help@r-project.org 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.

Reply via email to