STATS 10 Assignment 1
Please submit both parts of the assignment in one single PDF file. You can use any PDF editor
software to merge the two parts into one file. Please make sure that the questions are in the correct
order and clearly labeled, and that the answers are legible and easy to read.
To submit your assignment, upload the PDF file under the designated assignment page on the
course website before the deadline specified. Email or hard copy submissions are not accepted.
Part I
Include both the R commands and their corresponding outputs, results, or answers for all
exercise questions in Part I.
1. Vectors:
a. Create a vector named heights that contains the heights, in inches, of yourself and two
students near you. Print the contents of this vector.
b. Create a vector named names that contains the names of these people. Print the contents
of this vector.
c. Try typing cbind(heights, names). What did this command do? What class is this new
object?
Hint: Try the class() function.
2. Downloading data:
a. Download the data set births.csv from the course site and upload it into RStudio. Name
the data frame NCbirths.
b. Demonstrate that you have been successful by typing head(NCbirths) and copying and
pasting the output into your word processing document.
3. Package loading
a. Install the maps package. Verify its installation by typing find.package("maps") and
include the output in your answer.
b. Type library(maps) to load up the package. Type map("state") and include the plot output
in your answer.