From 8851116c7106c3330113300e325e888ea0233539 Mon Sep 17 00:00:00 2001 From: Luyi Dai Date: Tue, 1 Oct 2019 18:31:11 -0400 Subject: [PATCH 1/2] class activity 3 --- class-activity-3.Rmd | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/class-activity-3.Rmd b/class-activity-3.Rmd index d8dd1d6..f628bcf 100644 --- a/class-activity-3.Rmd +++ b/class-activity-3.Rmd @@ -1,7 +1,7 @@ --- title: "class activity 3" -author: "Charles Lang" -date: "10/2/2018" +author: "Luyi Dai" +date: "10/1/2018" output: html_document --- @@ -43,13 +43,15 @@ 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(x=data, y=value01, colour = variable)) + + geom_line() ``` 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} - +cities <- read.table("cities.txt", header = TRUE) +troops <- read/table("troops.txt", header = TRUE) ggplot(cities, aes(long, lat)) + geom_path(aes(size = survivors, colour = direction, From be0b9a41a8e466f10b07a82916136be5402b4591 Mon Sep 17 00:00:00 2001 From: Luyi Dai Date: Tue, 1 Oct 2019 18:42:25 -0400 Subject: [PATCH 2/2] updata year --- class-activity-3.Rmd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/class-activity-3.Rmd b/class-activity-3.Rmd index f628bcf..178fa03 100644 --- a/class-activity-3.Rmd +++ b/class-activity-3.Rmd @@ -1,7 +1,7 @@ --- title: "class activity 3" author: "Luyi Dai" -date: "10/1/2018" +date: "10/1/2019" output: html_document --- @@ -43,7 +43,7 @@ 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(x=data, y=value01, colour = variable)) + +ggplot(economics_long, aes(x=date, y=value01, colour = variable)) + geom_line() ``` @@ -51,7 +51,7 @@ If you would like to recreate the Minard graphic of Napoleon's Troops the code i ```{r} cities <- read.table("cities.txt", header = TRUE) -troops <- read/table("troops.txt", header = TRUE) +troops <- read.table("troops.txt", header = TRUE) ggplot(cities, aes(long, lat)) + geom_path(aes(size = survivors, colour = direction, @@ -64,6 +64,6 @@ 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_size(range = c(1, 10)) ```