Search code examples
rdata-scienceanalytics

Extract the unique genres and its count and store in data frame with index key


How do you split the multiple values of a variable in R programming. Image with column GenreLike, in the image the genre has multiple values in it's cells. how do you separate them and get count of the values in a table.


Solution

  • table(trimws(unlist(strsplit(df$Genre, split = ","))))