0
#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

camille
  • 16,432
  • 18
  • 38
  • 60
  • You can give a separator to `separate_rows`. If you look at the docs, it separates by punctuation marks by default, which includes `-` – camille Jan 05 '20 at 16:54

1 Answers1

2

Try separate_rows(input, genre, sep='\\|')

(sep is a regular expression so the | needs to be escaped with \\.)

Kent Johnson
  • 3,320
  • 1
  • 22
  • 23