Credit and thank you to Prof. Mine Çentinkaya-Rundel for designing the original template of this homework assignment, (see here for the original).
In this homework assignment you will…
R
packageYou can find the repo for this assignment here: https://classroom.github.com/a/GwNyScMv.
Clone the repo and start a new project in RStudio.
Here we revisit the iris
dataset from base R
and plot petal length vs sepal length colored by species of iris flower.
%>%
iris ggplot(aes(x = Sepal.Length, y = Petal.Length, color = Species)) +
geom_point()
Pick a package. You can choose one from the list below, or venture into the great unknown and find another online. If you have trouble getting a package to work, ask for help on slack.
Install the package. Be sure to do this in the Console, not in your R Markdown document because you do not want to keep re-installing every time you knit the document.
Depending on where the package comes from, how you install the package differs:
- If the package is on CRAN (Comprehensive R Archive Network), you can install it with `install.packages`.
- If the package is only on Github (most likely because it is still under development), you need to use the `install_github` function, click [here](https://www.rdocumentation.org/packages/devtools/versions/1.13.6/topics/install_github) for more details.
Load the package. Regardless of how you installed the package you can load it with the library
function.
Do something with the package. Typically, simpler is better. The goal is for you to read and understand the package documentation to carry out a simple task.
Finally, write a short 3-4 sentence statement (at the beginning of your solution to this exercise) and include:
Sample list of packages on CRAN:
package name | description |
---|---|
ape | Manipulate, plot and interact with phylogenetic trees and models. Comes with sample data |
astrodatR | Astronomy datasets |
cowsay | Allows printing of character strings as messages/warnings/etc. with ASCII animals, including cats, cows, frogs, chickens, ghosts, and more |
babynames | US Baby Names 1880-2015 |
dragracer | These are data sets for the hit TV show, RuPaul’s Drag Race. Data right now include episode-level data, contestant-level data, and episode-contestant-level data |
datapasta | RStudio addins and R functions that make copy-pasting vectors and tables to text painless |
DiagrammeR | Graph/Network Visualization |
janeaustenr | Full texts for Jane Austen’s 6 completed novels, ready for text analysis. These novels are “Sense and Sensibility”, “Pride and Prejudice”, “Mansfield Park”, “Emma”, “Northanger Abbey”, and “Persuasion” |
ggimage | Supports image files and graphic objects to be visualized in ‘ggplot2’ graphic system |
gganimate | Create easy animations with ggplot2 |
gt | Easily Create Presentation-Ready Display Tables |
leaflet | Create Interactive Web Maps with the JavaScript ‘Leaflet’ Library |
praise | Build friendly R packages that praise their users if they have done something good, or they just need it to feel better |
plotly | Create interactive web graphics from ggplot2 graphs and/or a custom interface to the JavaScript library plotly.js inspired by the grammar of graphics |
suncalc | R interface to suncalc.js library, part of the SunCalc.net project, for calculating sun position, sunlight phases (times for sunrise, sunset, dusk, etc.), moon position and lunar phase for the given location and time |
schrute | The complete scripts from the American version of the Office television show in tibble format |
statebins | The cartogram heatmaps generated by the included methods are an alternative to choropleth maps for the United States and are based on work by the Washington Post graphics department in their report on “The states most threatened by trade” |
ttbbeer | An R data package of beer statistics from U.S. Department of the Treasury, Alcohol and Tobacco Tax and Trade Bureau (TTB) |
ttbbeer | An R data package of beer statistics from U.S. Department of the Treasury, Alcohol and Tobacco Tax and Trade Bureau (TTB) |
ukbabynames | Full listing of UK baby names occurring more than three times per year between 1996 and 2015, and rankings of baby name popularity by decade from 1904 to 1994 |
wesanderson | Color palettes from Wes Anderson films |
scatterplot3d | Create 3D plots |
Knit to PDF to create a PDF document. Stage and commit all remaining changes, and push your work to GitHub. Make sure all files are updated on your GitHub repo.
Only upload your PDF document to Gradescope. Before you submit the uploaded document, link each answer to the appropriate page(s). If any answer spans multiple pages, then mark all pages. Associate the “Overall” section with the first page.
Component | Points |
---|---|
Ex 1 | 19 |
Ex 2 | 25 |
Workflow & formatting | 6 |