Portal Data Manipulation Pipes (dplyr)
Download a copy of the
Portal Teaching Database surveys table
and load it into R using read.csv()
.
Use pipes (%>%
) to combine the following operations to manipulate the data.
- Use
mutate()
,select()
, andfilter()
withis.na()
to create a new data frame with theyear
,species_id
, and weight in kilograms of each individual, with no null weights. - Use the
filter()
andselect()
to get theyear
,month
,day
, andspecies_id
columns for all of the rows in the data frame wherespecies_id
isSH
.