Skip to content

Instantly share code, notes, and snippets.

@LetticiaNicoli
Last active May 9, 2019 01:13
Show Gist options
  • Select an option

  • Save LetticiaNicoli/34cd614497b8b99b3b39e725e0bc6a1a to your computer and use it in GitHub Desktop.

Select an option

Save LetticiaNicoli/34cd614497b8b99b3b39e725e0bc6a1a to your computer and use it in GitHub Desktop.
Basic filters in R
#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