mam następujące wejściaodjąć dwa ciągi od siebie
#mydata
ID variable1 variable2
1 a,b,c,d c,a
2 g,f,h h
3 p,l,m,n,c c,l
życzę odjąć struny varible2 z variable1 i chciałbym mieć następujący wynik?
#Output
ID Output
1 b,d
2 g,f
3 p,m,n
#dput
structure(list(ID = 1:3, variable1 = structure(1:3, .Label = c("a,b,c,d",
"g,f,h", "p,l,m,n,c"), class = "factor"), variable2 = structure(c(1L,
3L, 2L), .Label = c("c,a", "c,l", "h"), class = "factor")), .Names = c("ID",
"variable1", "variable2"), class = "data.frame", row.names = c(NA,
-3L))
@Sotos Tak, to może być, ale myślałem, że chciałbym pokazać oczekiwany wynik – akrun
dobre myślenie. Mam ci znak wyboru :) – Sotos
Dzięki, dodałem kolejną metodę z 'cSplit' – akrun