Access data from the global plant phenology data portal (PPO data portal)
Usage
ppo_data(
scientificName = NULL,
genus = NULL,
specificEpithet = NULL,
termID = NULL,
fromYear = NULL,
toYear = NULL,
fromDay = NULL,
toDay = NULL,
bbox = NULL,
source = NULL,
subSource = NULL,
status = NULL,
mapped_traits = NULL,
eventRemarks = NULL,
limit = 100000L,
timeLimit = 60,
keepData = FALSE
)
Arguments
- scientificName
(character) A plant species scientific name.
- genus
(character) A plant genus name. See details.
- specificEpithet
(character) A plant specific epithet
- termID
(character) A single termID from the plant phenology ontology. See details.
- fromYear
(integer) return data from the specified year
- toYear
(integer) return data up to and including the specified year
- fromDay
(integer) return data starting from the specified day
- toDay
(integer) return data up to and including the specified day
- bbox
(character) return data within a bounding box. Format is
lat,long,lat,long
and is structured as a string. Use this website: http://boundingbox.klokantech.com/ to quickly grab a bbox (set format on bottom left to csv and be sure to switch the order from long, lat, long, lat to lat, long, lat, long).- source
(character) return data from specified source. See details.
- subSource
(character) return data from the specified sub-source. See details.
- status
(character) Either "present" or "absent". Return data with the specified status.
- mapped_traits
(character) return data from the specified traits. See details
- eventRemarks
(character) return data from the specified eventRemarks
- limit
(integer) limit returned data to a specified number of records
- timeLimit
(integer) set the limit of the amount of time to wait for a response
- keepData
(logical) whether to keep (TRUE) or delete (FALSE; default) the downloaded data (~/ppo_download/).
Value
A list with the following elements:
`data`: A data frame containing data
`readme`: A string with information about the return package
`citation`: A string with citation information
`number_possible`: An integer with total possible results
`status_code`: An integer with status code returned from server
Details
The ppo_data function returns a list containing the following information:
a readme file, citation information, a data frame with data, an integer with
the number of records returned and a status code. The function is called with
parameters that correspond to values contained in the data itself which act
as a filter on the returned record set. For a list of available mapped_traits,
termID, Source and subSource see the ppo_filters
dataset. For mapped_traits and
termID, the ppo_get_terms
function will return a data.frame with present,
absent or both terms and traits information. The ppo_terms
will
do the same but will use the API to get the lastest data. However, some of
the traits/termID may not return any results from this function.
See their documentation for more details.
Examples
r1 <- ppo_data(genus = c("Quercus", "Pinus"), termID='obo:PPO_0002313',
limit=10, timeLimit = 4)
#> sending request for data ...
#> https://biscicol.org/api/v3/download/_search?q=+genus:("Quercus","Pinus")++AND+++termID:"obo:PPO_0002313"&limit=10
#> The server is not responding.
#> If the problem persists contact the author.
head(r1$data)
#> NULL
r2 <- ppo_data(fromDay = 1, toDay = 100, bbox="37,-120,38,-119", limit=10,
timeLimit = 4)
#> sending request for data ...
#> https://biscicol.org/api/v3/download/_search?q=+dayOfYear:<=1++AND+++dayOfYear:<=100++AND+++latitude:>=37+AND++latitude:<=38+AND++longitude:>=-120+AND++longitude:<=-119&limit=10
#> The server is not responding.
#> If the problem persists contact the author.
head(r2$data)
#> NULL