Due 2/23 by the start of class.
Working in R
Start an instance of RStudio using the project file inside your
learningR folder. Start a new R Markdown file
- Give it a title, an author, and a date (feel free to play with a
table of contents or code folding as well)
- Keep the
setup code chunk already in the new R Markdown
file, but delete everything else.
- Create a new code chunk to read in TWO of the stepping stones
variables I’ve collected (you might want to focus on two of the
variables assigned to your group, but you’re welcome to use any of them)
– all of the variables can be found on this
github site. To get the url for the data you want to read in, click
on the csv file and then click the button that says “Raw” at the top of
the resulting page; this should open up a window with the
comma-delimited text for that dataset – use the url for this page.
- Do any data preparation you believe is necessary to make a clear and
beautiful graph of the seleced variables. This might involve fixing or
revising the names, the years, or other elements (but it might not be
necessary; I usually don’t know if it’s necessary until I start making
figures and find I have to go back and do some more data prep).
- Create a figure for each of your selected measures. Make sure these
contain good titles or subtitles or captions, choose your axis titles
with intention, adjust scales and breaks and scale labels as needed,
select colors and themes purposefully, add annotations or other figure
components that you think make the figure clearer. In short, practice
using the
ggplot functions we’ve talked about in the last
two weeks.
- Put each of these figures in their own section within the markdown
file and add some text either above or below each figure providing some
interpretation of what you see.
- When you’re done, knit the R markdown file to produce an .html
file.
Submit both the .Rmd file and the resulting .html file to me via
direct message on slack.
Working in Teams: Stepping Stones progress
For the coming week, teams should:
- Start an R markdown file that
- reads in the data you’ve (or I’ve) prepared in the data preparation
scripts and saved into csv files in the data folder (this includes the
initial pre-collected variables, variables 1-3 assigned to your team,
and variable 4 for which I’m sending scripts and csv files);
- visualizes each measure;
- narrates all of the measures you’re working with so far. You should
start with the visualizations you submitted last week (but look for
feedback from me) and the narrative descriptions you’ve been working on.
For this week, draft/revise and include a brief description to accompany
each variable, including variable 5, even though you probably can’t
include any visualization of this yet;
- makes note of any policy changes or events that should be noted on
the figures to help provide more context;
- Revise the scripts to download and prepare variables 1, 2, and 3, if
needed (you’ll hear more from me).
- For the final variable (V5) in your set, submit the data request
through the channels we’ve identified (Teams 1 and 5) or gather the data
via a more manual process (Teams 2, 3, 4) outlined in the stepping
stones teams document. Make it a csv file, structured like the csv files
current on github, and share it on slack.
This work should be submitted to the stepping stones channel in slack
so we can better learn from one another.