Re: [R] data.frame manipulation: Unbinding strings in a row

2008-01-10 Thread jim holtman
here is a quick hack: > x <- read.table(textConnection("ID ShopItems + ID1 A1 item1,item2,item3 + ID2 A2 item4,item5 + ID3 A1 item1,item3,item4"), header=TRUE) > y <- lapply(1:nrow(x), function(.row){ + .items <- strsplit(as.character(x$Items[.row]), ',')[[1

[R] data.frame manipulation: Unbinding strings in a row

2008-01-10 Thread francogrex
Hi all, I have a data.frame I received with data that look like this (comma separated strings in last row): ID ShopItems ID1 A1 item1, item2, item3 ID2 A2 item4, item5 ID3 A1 item1, item3, item4 But I would like to unbind the strings in col(2) items so that