EthanCampbellHW1

First Assignment for DACSS.

Ethan Campbell
2022-02-02

Basic Visualization

Here we visulize the data set MPG and look into tank size and mpg on the hwy.

ggplot(data = mpg) +
  geom_point(mapping = aes(x = displ, y = hwy))

Here we start using a second aes function. (Size and Color)

ggplot(data = mpg) +
  geom_point(mapping = aes(x = displ, y = hwy, size = cty, color = hwy))

Adding and removing the legend. Change show.legend to False to turn it off.

ggplot(data = mpg) +
  geom_smooth(mapping = aes(x = displ, y = hwy, color = drv),
    show.legend = TRUE)

Here is the combination of the above sets.

ggplot(data = mpg) + 
  geom_point(mapping = aes(x = displ, y = hwy, color = drv)) +
  geom_smooth(mapping = aes(x = displ, y = hwy, linetype = drv, color = drv),
              show.legend = TRUE
              )

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY-NC 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

Citation

For attribution, please cite this work as

Campbell (2022, Feb. 3). Data Analytics and Computational Social Science: EthanCampbellHW1. Retrieved from https://github.com/DACSS/dacss_course_website/posts/httpsrpubscomethancampbell860941/

BibTeX citation

@misc{campbell2022ethancampbellhw1,
  author = {Campbell, Ethan},
  title = {Data Analytics and Computational Social Science: EthanCampbellHW1},
  url = {https://github.com/DACSS/dacss_course_website/posts/httpsrpubscomethancampbell860941/},
  year = {2022}
}