Repeat one column values by another column values in R data frame -



Repeat one column values by another column values in R data frame -

this question has reply here:

r: how split string on column , move each substring next line? 3 answers splitting string new rows in r 3 answers

i have next info frame:

v1 v2 1 a,b,a 2 a,c 3 b,b 4 a,c,b,c

how can utilize have next info frame?

v1 v2 1 1 b 1 2 2 c 3 b 3 b 4 4 c 4 b 4 c

try csplit

library(data.table) library(devtools) source_gist(11380733) ## csplit(df, 'v2', ",", 'long') # v1 v2 #1: 1 #2: 1 b #3: 1 #4: 2 #5: 2 c #6: 3 b #7: 3 b #8: 4 #9: 4 c #10: 4 b #11: 4 c

r

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -