Guest User

Untitled

a guest
Oct 18th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. library(tidyverse)
  2.  
  3. mpg %>%
  4. mutate(foreign = ifelse(manufacturer == "audi" |
  5. manufacturer == "honda" |
  6. manufacturer == "hyundai" |
  7. manufacturer == "land rover" |
  8. manufacturer == "nissan" |
  9. manufacturer == "subaru" |
  10. manufacturer == "toyota" |
  11. manufacturer == "volkswagen",
  12. TRUE, FALSE)) %>%
  13. select(manufacturer, model, cty, hwy, foreign) -> autoData
Add Comment
Please, Sign In to add comment