How to extract few selected words from a column and place it in another column?

I am working to extract words from a column. I want to extract words like Episode & Season from a column & place it in another column.

heres a starter example

library(dplyr)
library(stringr)
(example_data <- select(
  dplyr::starwars,
  name, height
))


(ex_d2 <- mutate(example_data,
  is_a_skywalker = str_detect(
    string = name,
    pattern = "Skywalker"
  )
) %>% arrange(desc(is_a_skywalker),
              name))
1 Like

@nirgrahamuk Thank you.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.