I have a R list of strings and I want to get the last element of each
require(stringr)
string_thing <- "I_AM_STRING"
Split <- str_split(string_thing, "_")
Split[[1]][length(Split[[1]])]
but how can I do this with a list of strings?
require(stringr)
string_thing <- c("I_AM_STRING", "I_AM_ALSO_STRING_THING")
Split <- str_split(string_thing, "_")
#desired result
answer <- c("STRING", "THING")