Problem set 2
Due by 11:59 PM on Thursday, October 11, 2018
For this problem set, you’ll be working with data from the 2010 US Religion Census, which provides county-level data on 236 religious groups in the United States. Because this data is a little unwieldy,The original data is the epitome of untidy. Each county has its own row, and each religion gets three columns:
LDSCNG for the number of congregations,
LDSADH for the number of adherents, and
LDSRATE for the number of adherents per 1,000 people in the county (but repeated for every religion!)
I’m giving you a pre-tidied version. Code for tidying the raw file, in case you’re interested, is available here.You should hopefully be able to understand most of the code I used.
Setting up your project
You can copy the “Problem Set 2” project on RStudio.cloud, which has this set up for you. But remember that you should eventually be moving off the cloud version and onto your computer, and this might be a good assignment to make that transition. Here are the instructions for installing everything on your computer.
Create a new RStudio project named “problem-set-2” (or whatever you want to call it) and put it somewhere on your computer.
Navigate to that new project folder on your computer with File Explorer (in Windows) or Finder (in macOS) (i.e. however you look at files on your computer).
Download this R Markdown fileYou’ll probably need to right click on the link and select “Save link as…”
and place it in your newly-created project (but not in your data folder—put it in the main directory):
Create a new folder in your problem set folder called “data”.
Download these two CSV files. They’ll probably go into your Downloads folder.You’ll probably need to right click on the link and select “Save link as…” or something similar—often browsers will load the CSV file like a web page, which isn’t helpful.
Using Windows File Explorer or macOS Finder, move the newly downloaded CSV files into the “data” folder you created.
In the end, your project folder should be structured like this:Make sure your
.Rmd file is not inside the data folder.
Completing the assignment
Ensure that you have your new
problem-set-2project open in RStudio. Open the
.Rmdfile from the “Files” panel in RStudio and follow the instructions there for the rest of the problem set.
xxxxplaceholders throughout the document where you should type text.
Feel free to delete the questions I provided and rewrite the text to be more narrative. So instead of keeping the instructions and hints, you can remove them and write things like “The top 10 religions in Utah are listed in the table below…”
.Rmdas a Word documentOr PDF if you’ve installed tinytex.
when you’re done and submit it via Learning Suite.