Guest User

Untitled

a guest
Nov 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. df <- data.frame(abc = c(1, 0, 3, 2, 0),
  2. foo = c(0, 4, 2, 1, 0),
  3. glorx = c(0, 0, 0, 1, 2))
  4.  
  5. new_col <- c('abc', 'foofoofoofoo', 'abcabcabcfoofoo', 'abcabcfooglorx', 'glorxglorx')
  6. also_acceptable <- c('abc', 'foofoofoofoo', 'abcfooabcfooabc', 'abcfooglorxabc', 'glorxglorx')
  7.  
  8. df %>% mutate(new_col = new_col, also_acceptable = also_acceptable)
Add Comment
Please, Sign In to add comment