[R] expand comma separated field vertically in data.frame

Daniel Brewer daniel.brewer at icr.ac.uk
Fri Nov 19 13:04:37 CET 2010


Hello,

I have a data.frame like this:
a	1,2,3,4	b1
b	6,7	b3

And I would like to transform it to this:
a	1	b1
a	2	b1
a	3	b1
a	4	b1
b	6	b3
b	7	b3

I have been looking at ddply but can't seem to work it out.  ANy help
would be gratefully received.

Dan

-- 
**************************************************************
Daniel Brewer, Ph.D.

Institute of Cancer Research
Molecular Carcinogenesis
Email: daniel.brewer at icr.ac.uk
**************************************************************

The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the a...{{dropped:2}}



More information about the R-help mailing list