Type: | Package |
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/. |
Version: | 1.0.3 |
Date: | 2016-04-11 |
Author: | Tom August |
Maintainer: | Tom August <tomaug@ceh.ac.uk> |
VignetteBuilder: | knitr |
URL: | https://github.com/BiologicalRecordsCentre/rYoutheria |
BugReports: | https://github.com/biologicalrecordscentre/rYoutheria/issues |
Depends: | R (≥ 3.0.0) |
Imports: | plyr, RJSONIO, reshape2, RCurl |
Suggests: | knitr, testthat, roxygen2 |
License: | MIT + file LICENSE |
RoxygenNote: | 5.0.1 |
NeedsCompilation: | no |
Packaged: | 2016-04-12 13:03:16 UTC; tomaug |
Repository: | CRAN |
Date/Publication: | 2016-04-12 17:01:41 |
Convert data returned from API to a dataframe
Description
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.
Usage
YoutheriaToDF(x)
Arguments
x |
a list of trait data as returned by |
Value
A data.frame
of melted trait data
Get country names from YouTheria
Description
Retrieves a data.frame
of country names and IDs from YouTheria.
Usage
getCountries()
Value
A dataframe of country names and IDs. These names can be used in getMeasurementData to restrict the search to a specific country
Examples
## Not run:
# Get a dataframe of all countries
getCountries()
## End(Not run)
Get location information from YouTheria
Description
Retrieves location information stored on YouTheria
Usage
getLocData(country = NULL, StudyUnitId = NULL)
Arguments
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 |
Value
A dataframe in which each rows gives the details of a study unit
Examples
## Not run:
# Get a dataframe of Indian study units
Indian_StudyUnits <- getLocData(country = 'India')
## End(Not run)
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 |
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 |
Value
A data.frame
with each row giving a trait measurement
Examples
## 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)
Get Measurement Types
Description
Retrieves a data.frame
of measurement types available from YouTheria.
Usage
getMeasurementTypes(measurementType = NULL)
Arguments
measurementType |
If |
Value
A dataframe of measurement types giving their Id and Name
Examples
## 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
Description
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