Skip to content

Commit

Permalink
update gg definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremymcwilliams committed Nov 6, 2019
1 parent c75ff0a commit ab318f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Link to this page: http://bit.ly/R-workshop2

in console (lower left-hand corner):
* `library(usethis)`
* `use_course("https://github.com/jeremymcwilliams/ggplot-workshop/archive/1.0.zip")`
* `use_course("https://github.com/jeremymcwilliams/ggplot-workshop/archive/1.0.1.zip")`

After running the command above, you'll be prompted whether to download to your current directory. Go ahead and answer in the affirmative (you'll be presented with variations on "yes"). Once the course files download, you'll be prompted as to whether to delete the zip file. Again, answer in the affirmative. Once you do, click "Save", and your window will refresh to a new R session.

Expand Down
10 changes: 5 additions & 5 deletions ggplot-handout.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ output:
ggplot is an R package created by Hadley Wickham (he's kind of a big deal in the R world). The "gg" translates to "grammar of graphics", and is founded in the idea that all data visualizations are comprised of three components:

* data set
* "geoms", or visual marks that represent the data (i.e. the stuff that you see)
* a coordinate system (e.g the type of plot)
* aesthetics, or visual marks that represent the data (i.e. the stuff that you see)
* geometric objects, or "geoms" (e.g the type of plot)

ggplot is part of the "tidyverse" - a series of packages that share common strategies for working with data and generating visualizations. In last Wednesday's workshop, we used some tidyverse packages (readr, dplyr) for reading and filtering datasets. Fortunately, there's a simple way to load all these libraries at once, as we'll use various functions spread throughout different packages in the tidyverse:

Expand Down Expand Up @@ -78,8 +78,8 @@ ggplot(data=jane, mapping=aes(x=Year, y=Count))+geom_line()
Looking at the code, here's how we're including the three basic parts of a ggplot chart:

* DATA - data=jane
* GEOMS - mapping=aes(x=Year, y=Count)
* COORDINATE SYSTEM - +geom_line()
* AESTHETICS - mapping=aes(x=Year, y=Count)
* GEOM - +geom_line()


```{r}
Expand Down Expand Up @@ -218,7 +218,7 @@ Suggested strategy:

* Find/examine a dataset, and decide upon a useful plot from that data
* Filter your data to get a subset of the larger dataset (if applicable). Consider using group_by() with summarise() if you want to plot statistical metrics (mean, standard deviation, etc.)
* Create an intial plot with the three basic components (data, geoms, coordinate set).
* Create an intial plot with the three basic components (data, aesthetics, geom).
* Augment your plot by adding labels, colors, etc.


Expand Down

0 comments on commit ab318f0

Please sign in to comment.