For this investigation we are going to use the sleepdata
data set from the lme4 package. Here is the head of the data frame:
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
# make fake dataset | |
df <- data.frame(x = runif(100, 0, 1), y = rnorm(100, 10, 3), z = rpois(100, 10)) | |
# subset dataframe | |
df_sub <- df[which(df$x >= 0.75), ] | |
# subset using dplyr | |
library(dplyr) | |
df_sub2 <- df %>% |
OlderNewer