Last active
February 2, 2019 03:19
-
-
Save toyeiei/d862f9cf4dd692277ed73b14cdf91383 to your computer and use it in GitHub Desktop.
glimpse dplyr 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# basic data wrangling | |
# 1. select columns | |
mtcars %>% select(mpg, hp, wt) | |
mtcars %>% select(1:4, 5) | |
# 2. filter rows | |
mtcars %>% filter(hp <= 100) | |
mtcars %>% filter(hp <= 100 & am == 1) | |
mtcars %>% filter(hp <= 90 | am == 0) | |
# 3. arrange rows | |
mtcars %>% arrange(mpg) | |
mtcars %>% arrange(desc(mpg)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment