How to separate title from desc (scraping data IMDB-Coming Soon Movie)

As mentionned earlier, have you installed stringr version 1.3.0 ? Can you check what version you have ? Thanks.

If you have stringr < 1.3.0, it won't work. So, if you can't or don't want to update, just replace the last mutate

mutate(
year = str_extract(title, “\(\d{4}\)”) %>%str_remove_all("[\(\)]"),
title = str_remove(title, “\(\d{4}\)$”) %>% str_trim()
)

by this one

  mutate(
    year = str_extract(title, "\\(\\d{4}\\)") %>%str_replace_all("[\\(\\)]", ""),
    title = str_replace(title, "\\(\\d{4}\\)$", "") %>% str_trim()
  )

Is this ok for you ?

Some comments about posting here and helping us help you:
Try to take care of the style of your code. Currently, your last answer is unreadable and not useful because code is not highlited properly.
In the answer box edition, you can select some text an click on this button to transform the block to code syntax:
image
You can check what you do in the preview on the left.
Also,

Thanks.

1 Like