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

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 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>