Skip to content

Instantly share code, notes, and snippets.

@seankross

seankross/stephan.R

Created Oct 5, 2017
Embed
What would you like to do?
library(dplyr)
c(2, 5, 6) %>% sum()
cars_i_want <- mtcars %>%
filter(mpg > 20) %>%
filter(cyl == 4) %>%
arrange(hp)
mtcars %>%
group_by(cyl) %>%
summarize(avg_mpg = mean(mpg))
library(tibble)
subjects <- tribble(
~Name, ~Sex, ~Age,
"Emily", "F", 22,
"Stephan", "M", 25,
"Sean", "M", 26
)
data <- data_frame(Name = sample(c(subjects$Name, "Bob"), 20, replace = TRUE),
Measurement = sample(1:10, 20, replace = TRUE))
data %>%
left_join(subjects)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.