Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 208657

Split column into rows when the Delimiter is vertical bar ( | ) in R [duplicate]

$
0
0

This question already has an answer here:

#Input Table :-

Movie  Genre


Avatar Action|Sci-Fi


#Output Table Required <- 

Movie   Genre

Avatar        Action

Avatar         Sci-Fi

#Consider the name of the dataframe is input

I tried

output <-separate_rows(input, genre)

The resulted in :-

Avatar        Action

Avatar         Sci

Avatar    Fi

Which is not what is required


Viewing all articles
Browse latest Browse all 208657

Latest Images

Trending Articles



Latest Images