Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
8 changes: 4 additions & 4 deletions class-activity-3.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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))
```

13 changes: 13 additions & 0 deletions class-activity-3.Rproj
Original file line number Diff line number Diff line change
@@ -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