0

I have a csv file from movielens that i'm trying to manipulate.

The movie list in my data.frame contains movie title and the year of movie and what i'm trying to separate the year and title to separate columns.

I used the folowing code:

movies <- extract(movies, title, c("title", "year"), "^(.*) \\(([0-9 \\-]*)\\)$")

I succeded to that but there is movies that contains only names and for those movies i get NA for the hole rows instead of getting NA for only "Year" column.

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

enter image description here

This is how the results looks