Skip to content

Commit

Permalink
class activity 3
Browse files Browse the repository at this point in the history
  • Loading branch information
yqi2013 committed Oct 1, 2019
1 parent 3a72ded commit 9147e3a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
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

0 comments on commit 9147e3a

Please sign in to comment.