Introduction to Writing Functions in R
Richie Cotton
Data Evangelist at DataCamp
glimpse(corn)
Observations: 6,381
Variables: 6
$ year <int> 1866, 1866, 1866, 1866, 1866, 1866...
$ state <chr> "Alabama", "Arkansas", "California...
$ farmed_area_acres <dbl> 1050000, 280000, 42000, 57000, 200...
$ yield_bushels_per_acre <dbl> 9.0, 18.0, 28.0, 34.0, 23.0, 9.0, ...
$ farmed_area_ha <dbl> 424919.92, 113311.98, 16996.80, 23...
$ yield_kg_per_ha <dbl> 79.29892, 158.59784, 246.70776, 29...
ggplot(dataset, aes(x, y)) +
geom_line(aes(group = group))
ggplot(dataset, aes(x, y)) +
geom_line(aes(group = group)) +
geom_smooth()
ggplot(dataset, aes(x, y)) +
geom_line(aes(group = group)) +
geom_smooth() +
facet_wrap(vars(facet))
dataset1 %>%
inner_join(dataset2, by = "column_to_join_on")
Introduction to Writing Functions in R