# LAB: Logic

This is the lab associated with the lesson on Lists in R.

Please upload your final completed lab on the Assignments page in Canvas, as per the instructions below.

You are welcome and expected to ask for help from the instructors if you get stuck: Please also come to the R Bootcamp on Fridayâ€”there is coffee and snacks!

# A. Michigan Tree Plot data

``````# Read in the data
header = TRUE, sep = '\t')
``````
1. Use the function which() to return which rows of the data pertain to Black Oak.

2. Use this expression to subset out the rows of data for Black Oak.

3. Use length() to return the number of trees of Black Oak.

4. Compare this number to the number of Hickory trees. Are there more Hickory than Black Oak?

5. Use which() to subset out the rows of data for all the Oak species.

6. Are there more Oak trees than all of the other species?

# B. New Haven 5K Race data

``````# Read in NHV road race results 2015.
``````
1. Use a logical statement to count how many runners were not from New Haven.

2. How many people ran faster or equal to 20 minutes (dat_nhv\$Nettime_mins)?

3. How many people ran faster than 20 minutes AND were from New Haven?

4. How many people ran faster than 20 minutes AND were from New Haven, Branford, Guilford, or Madison?