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:
You can check what you do in the preview on the left.
Also,
- Take a look at the markdown syntax, that you could use in a post:
Markdown Reference - and you can also look at the FAQ on how to do a reprex yourself:
FAQ: What's a reproducible example (`reprex`) and how do I create one?
Thanks.