Re: [R] Reformatting text inside a data frame

2015-09-07 Thread David Winsemius
> On Sep 7, 2015, at 1:20 PM, Jon BR wrote: > > Hi John, > Thanks for the reply; I'm pasting here the output from dput, with a > 'df <-' added in front: > > df <- structure(list(rowNum = c(1, 2, 3), first = structure(c(NA, 1L, > 2L), .Label = c("AD=2;BA=8", "AD=9;BA=1"), class = "factor"),

Re: [R] Reformatting text inside a data frame

2015-09-07 Thread Jon BR
Hi John, Thanks for the reply; I'm pasting here the output from dput, with a 'df <-' added in front: df <- structure(list(rowNum = c(1, 2, 3), first = structure(c(NA, 1L, 2L), .Label = c("AD=2;BA=8", "AD=9;BA=1"), class = "factor"), second = structure(c(2L, 1L, NA), .Label = c("AD=1;BA=2"

Re: [R] Reformatting text inside a data frame

2015-09-07 Thread John Kane
I'm not making a lot of sense of the data, it looks like you want more recodes than you have mentioned but in any case you might want to look at the recode function in the car package. It "should" do what you want thought there may be faster ways to do it. BTW, for supplying sample data have