Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. # This takes a character vector (like the levels of a factor) and prints each element in quotes with commas between.
  2. # (There has got to be a better way to do this.)
  3. # BUT it does the trick for nasty, nasty, shameful copying and pasting.
  4.  
  5. make_editable_list = function(x){
  6. step1 = paste0(levels(x), collapse = "\", \"")
  7. step2 = paste0("\"", step1, "\"")
  8.  
  9. return(cat(step2))
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement