Chapter 5 Assessement
- True or False: The best way to keep your files organized for analysis is to indicate and set the working directory in each R script.
- Fill in the operator used to create an object named “age” which contains the values 18, 19, 20, and 17:
- I have a vector that includes many different types of berries in a specific order (see below). How do I subset just “strawberries” from the object?
A. berries[1]
B. berries(1)
C. berries[,1]
D. berries[c(2)]
- After reading a data frame into R using the following code, I want to explore my data.
mydata <- read.csv(“data/mydata.csv”).
Match the following functions with questions about the data:
Functions | Questions |
---|---|
str(mydata) | What is the first row in my data frame? |
head(mydata) | What is the class of the row named row1? |
view(mydata) | What are the first few rows in the data frame? |
mydata[,1] | What is in the row named row1? |
“mydata$row1” | What is the data frames structure? |
“class(mydata$row1)” | What does my data frame look like? |
- Activity:
Download specimen data for a species of interest using the iDigBio API in R following the steps learned in section 4.
- What species did you download records for?
- How many observations were in this record set?
- Plot a map of these records and save this plot as a jpg.