title “Week 1 R Exercises”
author:‘Grace West’
output:html_document

Below are questions to answer using R, based on the documents you just read. Enter your answers in this Rmd file, using the space provided below each question! Then upload this Rmd file when you are done.

When you are done, you should be able to click the “Knit” button and see a pretty version of your assignment. But if this last step doesn’t work for you, it is not crucial. No points will be deducted.

In the Intro to R document, you recreated some of the displays and preliminary analysis of Arbuthnot’s baptism data. Your assignment involves repeating these steps, but for present day birth records in the United States. Load the “present” data in R with the following command.

source("http://www.openintro.org/stat/data/present.R")

If the above command is successful, then it should run and not return any output. The data will be stored in a data frame called present.

  1. What years are included in this data set? What are the dimensions of the data frame and what are the variable or column names?

1940 - 2002 Years, boys, girls

# (YOU CAN ADD LINES IF NEEDED)
  1. How do these counts compare to Arbuthnot’s? Are they on a similar scale? (This will require you to look back at the Arbuthnot data.)

The U.S plot is not on a similar scale at all, their counts are several hundred times larger than Arbuthnot’s

# ENTER YOUR R COMMAND(S) HERE
# (YOU CAN ADD LINES IF NEEDED)
  1. Make a plot that displays the boy-to-girl ratio for every year in the data set, where the x-axis label is “Year” and y-axis label is “Ratio” (see the “Intro to R” document for detail on axis labels). What do you see? Does Arbuthnot’s observation about boys being born in greater proportion than girls hold up in the U.S.?

ENTER TEXT FOR YOUR ANSWER HERE.

# ENTER YOUR R COMMAND(S) HERE
# (YOU CAN ADD LINES IF NEEDED)
  1. In what year did we see the largest total number of births in the U.S.? You can refer to the help files or the R reference card http://cran.r-project.org/doc/contrib/Short-refcard.pdf to find helpful commands.

In the year, 2000

# ENTER YOUR R COMMAND(S) HERE
# (YOU CAN ADD LINES IF NEEDED)