diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b6a065 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata diff --git a/class-activity-3.Rmd b/class-activity-3.Rmd index d8dd1d6..8f45242 100644 --- a/class-activity-3.Rmd +++ b/class-activity-3.Rmd @@ -43,13 +43,13 @@ ggplot(mpg, aes(displ, hwy, color = class)) + Can you create a line graph using the "economics_long" data set that shows change over time in "value01" for different categories of "variable"? ```{r} - +ggplot(economics_long, aes(date, value01, color = variable)) + + geom_line() + facet_grid(vars(variable)) ``` If you would like to recreate the Minard graphic of Napoleon's Troops the code is below and the data is in this repo. ```{r} - ggplot(cities, aes(long, lat)) + geom_path(aes(size = survivors, colour = direction, @@ -61,7 +61,7 @@ size = 4) last_plot() + scale_x_continuous("", limits = c(24, 39)) + scale_y_continuous("") + - scale_colour_manual(values = c("grey50","red")) + - scale_size(to = c(1, 10)) + scale_colour_manual(values = c("purple","green")) + + scale_size(range = c(1, 10)) ``` diff --git a/class-activity-3.Rproj b/class-activity-3.Rproj new file mode 100644 index 0000000..8e3c2eb --- /dev/null +++ b/class-activity-3.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX