SHARE
TWEET

Untitled

a guest Jan 4th, 2013 19 Never
  1. d <- data.frame(a = c("A_foo1", "B_foo2", " _foo3"))
  2.        
  3. a
  4. A
  5. B
  6. " "
  7.        
  8. a <- c("A_foo1", "B_foo2", " _foo3")
  9. gsub("_.*", "", a)
  10. #[1] "A" "B" " "
RAW Paste Data
Top