Skip to content

Instantly share code, notes, and snippets.

@alanmarazzi
Last active November 3, 2015 15:40
Show Gist options
  • Save alanmarazzi/c8c9b757f6df03ceca48 to your computer and use it in GitHub Desktop.
Save alanmarazzi/c8c9b757f6df03ceca48 to your computer and use it in GitHub Desktop.
The Beginning of an AdventuRe example code
library(ggplot2) # This loads ggplot2 package, it's better and easier than base R plot
# This is the colors' palette used in the chart
pal <- c("#0E37B1", "#FF4100", "#00B65E", "#FFAE00", "#394C86", "#C66746", "#318A5F", "#C69E46")
# Here the code for the plot [don't worry, in next posts I'll
# explain better every line of code, just keep following me ;) ]
ggpoints <- ggplot(df, aes(HC, LC, color = Country))+
geom_point(size = 3, shape = 16)+
scale_color_manual(values = pal)+
theme_bw()+
geom_abline(intercept = 9.891, slope = 5.022, colour = "dodgerblue2", size = 1, alpha = .8)+
theme(
axis.title = element_text(size = 15, family = "sans"),
axis.text = element_text(size = 10),
legend.position = "none"
)+
labs(x = "Headcount", y = "Labor Cost")
ggpoints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment