Title: | Access to the YouTheria Mammal Trait Database |
---|---|
Description: | A programmatic interface to web-services of YouTheria. YouTheria is an online database of mammalian trait data <http://www.utheria.org.uk/>. |
Authors: | Tom August |
Maintainer: | Tom August <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.0 |
Built: | 2024-11-12 05:42:13 UTC |
Source: | https://github.com/biologicalrecordscentre/ryoutheria |
Retrieves a data.frame
of country names and IDs from YouTheria.
getCountries()
getCountries()
A dataframe of country names and IDs. These names can be used in getMeasurementData to restrict the search to a specific country
## Not run: # Get a dataframe of all countries getCountries() ## End(Not run)
## Not run: # Get a dataframe of all countries getCountries() ## End(Not run)
Retrieves location information stored on YouTheria
getLocData(country = NULL, StudyUnitId = NULL)
getLocData(country = NULL, StudyUnitId = NULL)
country |
Character specifying the country within which to search for locations. for a list of countries used getCountries(). |
StudyUnitId |
Numeric specifying the StudyUnitId to search for |
A dataframe in which each rows gives the details of a study unit
## Not run: # Get a dataframe of Indian study units Indian_StudyUnits <- getLocData(country = 'India') ## End(Not run)
## Not run: # Get a dataframe of Indian study units Indian_StudyUnits <- getLocData(country = 'India') ## End(Not run)
Retrieves a data.frame
of trait measurements with facilities to select by
location, species name and/or measurement type.
getMeasurementData(measurementType = NA, MSW93Binomial = NA, MSW05Binomial = NA, country = NULL, StudyUnitId = NULL, locationData = TRUE, locationOnly = FALSE, cast = TRUE, silent = FALSE)
getMeasurementData(measurementType = NA, MSW93Binomial = NA, MSW05Binomial = NA, country = NULL, StudyUnitId = NULL, locationData = TRUE, locationOnly = FALSE, cast = TRUE, silent = FALSE)
measurementType |
Measurement types to collect data for. If |
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 |
StudyUnitId |
Numeric specifying the StudyUnitId from which you wish to collect data.
If |
locationData |
Logial dictating whether location information should be added to the
output. Defualt is |
locationOnly |
If |
cast |
If |
silent |
If |
A data.frame
with each row giving a trait measurement
## 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)
## 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)
Retrieves a data.frame
of measurement types available from YouTheria.
getMeasurementTypes(measurementType = NULL)
getMeasurementTypes(measurementType = NULL)
measurementType |
If |
A dataframe of measurement types giving their Id and Name
## Not run: # Get a dataframe of all measurement types AllMT <- getMeasurementTypes() # Seach by name BM_MT <- getMeasurementTypes('Body Mass') BM_LL_MT <- getMeasurementTypes(c('Body Mass','Limb Length')) # Search by ID MT1 <- getMeasurementTypes(1) MT123 <- getMeasurementTypes(1:3) ## End(Not run)
## Not run: # Get a dataframe of all measurement types AllMT <- getMeasurementTypes() # Seach by name BM_MT <- getMeasurementTypes('Body Mass') BM_LL_MT <- getMeasurementTypes(c('Body Mass','Limb Length')) # Search by ID MT1 <- getMeasurementTypes(1) MT123 <- getMeasurementTypes(1:3) ## End(Not run)
The rYouTheria package harnesses the YouTheria wedsite's APIs to give easy access
to a large amount of mammal trait data. The package allows the user to select data
by species, location and measurement type. More information can be found out about
the YouTheria dataset at http://www.utheria.org/
Click on the index link below for more information on each
function
Takes the list returned by fromJSON(getURL(url))
, where
url is the ValueByType controller in the YouTheria API, and returns
a data.frame. This code is faster than using plyr.
YoutheriaToDF(x)
YoutheriaToDF(x)
x |
a list of trait data as returned by |
A data.frame
of melted trait data