Skip to content

Instantly share code, notes, and snippets.

View maggiesuero's full-sized avatar
😎

Maggie Suero maggiesuero

😎
View GitHub Profile
@rudeboybert
rudeboybert / modeling_with_data_tidyverse.R
Last active April 16, 2024 18:16
R source code for "Modeling with Data in the Tidyverse" DataCamp course
# R source code for all slides/videos in Albert Y. Kim's "Modeling with Data in
# the Tidyverse" DataCamp course:
# https://www.datacamp.com/courses/modeling-with-data-in-the-tidyverse
# This code is available at http://bit.ly/modeling_tidyverse
# Load all necessary packages -----
library(ggplot2)
library(dplyr)
library(moderndive)
@thomasp85
thomasp85 / gapminder.r
Created June 6, 2018 19:05
Gapminder example with gganimate
library(gapminder)
library(ggplot2)
library(gganimate)
p <- ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, colour = country)) +
geom_point(alpha = 0.7) +
scale_colour_manual(values = country_colors) +
scale_size(range = c(2, 12)) +
scale_x_log10() +
facet_wrap(~continent) +
@benmarwick
benmarwick / rotate-axis-labels-ggplot2.R
Last active March 30, 2024 08:00
I can never remember how to rotate the x-axis labels with ggplot2: theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5))
# Adapted from https://stackoverflow.com/a/7267364/1036500 by Andrie de Vries
# This is it: theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5))
library(ggplot2)
td <- expand.grid(
hjust=c(0, 0.5, 1),
vjust=c(0, 0.5, 1),
angle=c(0, 45, 90),
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #