Last active
May 9, 2019 01:13
-
-
Save LetticiaNicoli/34cd614497b8b99b3b39e725e0bc6a1a to your computer and use it in GitHub Desktop.
Basic filters in R
This file contains hidden or 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
| #Filters | |
| mtcars | |
| mtcars[2,5] #row,column | |
| mtcars[2:4,5] | |
| mtcars[2:4,5:7] | |
| mtcars[8:9, c(1,2,4)] | |
| mtcars[2:4, c("mpg", "wt")] | |
| #Filter mpg >= 15 | |
| row.names(mtcars[mtcars[,1] >= 15,]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment