Learn R Programming

rYoutheria (version 1.0.3)

getMeasurementData: Get a table of trait measurements from YouTheria

Description

Retrieves a data.frame of trait measurements with facilities to select by location, species name and/or measurement type.

Usage

getMeasurementData(measurementType = NA, MSW93Binomial = NA, MSW05Binomial = NA, country = NULL, StudyUnitId = NULL, locationData = TRUE, locationOnly = FALSE, cast = TRUE, silent = FALSE)

Arguments

measurementType
Measurement types to collect data for. If NULL (default), all measurement types are returned. Can also be 'numeric' or 'character' (or a list of either type) and will filter by MeasurementTypeID and the measurement respectivly. MeasurementTypeIDs and names can be found using getMeasurementTypes().
MSW93Binomial
Character giving the latin name of a species (or list of species) for which measurements are required. Naming should follow Mammal Species of the World 1993.
MSW05Binomial
Character giving the latin name of a species (or list of species) for which measurements are required. Naming should follow Mammal Species of the World 2005.
country
Character specifying the country from which you wish to collect data. If NULL all data is retrieved. If specified then locationOnly is set to TRUE
StudyUnitId
Numeric specifying the StudyUnitId from which you wish to collect data. If NULL all data is retrieved
locationData
Logial dictating whether location information should be added to the output. Defualt is FALSE but is set to TRUE if either StudyUnitId or country are specified.
locationOnly
If TRUE data is only be returned if it has location information.
cast
If TRUE (default) then the data is cast so that each observation is one row in the output. If false then each observation has one row for each data element recorded (i.e. range, mean, units, etc)
silent
If TRUE progress reporting is silenced

Value

A data.frame with each row giving a trait measurement

Examples

Run this code

## Not run: 
# # Select measurement type by id
# M14 <- getMeasurementData(14)
# M22_7_2 <- getMeasurementData(c(22,7,2))
# 
# # Select measurement type by name
# WM <- getMeasurementData('Wing Morphology')
# WM_TN <- getMeasurementData(c('Wing Morphology','Teat Number'))
# 
# # Select by measurement type and species name
# PpPr_bodymass <- getMeasurementData(measurementType = 1,
#                                     MSW93Binomial = c('Pongo pygmaeus','Peroryctes raffrayana'))
#                    
# #Select by measurement type, species name and location
# Ob_Activity_Tanz <- getMeasurementData(measurementType = 'Activity Cycle',
#                                        MSW05Binomial = 'Oryx beisa',
#                                        country = 'Tanzania')
# ## End(Not run)

Run the code above in your browser using DataLab