I have a data frame like so:
df <- structure(list(A = c(\"3 of 5\", \"1 of 2\", \"1 of 3\", \"1 of 3\", \"3 of 4\", \"2 of 7\"), B = c(\"2 of 2\", \"2 of
Just another tidyverse way:
purrr::map_dfc(names(df), function(i) { df %>% separate(i, sep = "of", remove = T, into = c(paste0(i, "_attempted"), paste0(i, "_landed"))) }) %>% dplyr::select(., contains("_"))