Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. x <- strsplit('dark_room',"_")
  2. x[[1]][2]
  3. [1] "room"
  4.  
  5. sub(".*_", "", x)
  6.  
  7. [1] "room"
  8.  
  9. library(stringr)
  10. word('dark_room', -1, sep="_")
  11. #[1] "room"
  12.  
  13. str_extract('dark_room', "[^_]+$")
  14. #[1] "room"
  15.  
  16. sapply( strsplit('dark_room',"_"), tail, 1)
  17. #[1] "room"
  18.  
  19. tail(scan(text = 'dark_room', what = "", sep="_"), 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement