Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(tidyverse)
- mpg %>%
- mutate(foreign = ifelse(manufacturer == "audi" |
- manufacturer == "honda" |
- manufacturer == "hyundai" |
- manufacturer == "land rover" |
- manufacturer == "nissan" |
- manufacturer == "subaru" |
- manufacturer == "toyota" |
- manufacturer == "volkswagen",
- TRUE, FALSE)) %>%
- select(manufacturer, model, cty, hwy, foreign) -> autoData
Add Comment
Please, Sign In to add comment