Skip to contents

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
head(r1$data)
#>   dayOfYear year genus specificEpithet             eventRemarks latitude
#> 1        42 2016 Pinus       ponderosa Emerging needles (pines) 40.40239
#> 2       249 2019 Pinus           taeda Emerging needles (pines) 33.83608
#> 3       246 2019 Pinus           taeda Emerging needles (pines) 33.83608
#> 4       247 2019 Pinus           taeda Emerging needles (pines) 33.83608
#> 5       248 2019 Pinus           taeda Emerging needles (pines) 33.83608
#> 6        35 2016 Pinus       ponderosa Emerging needles (pines) 40.40239
#>    longitude
#> 1 -104.69910
#> 2  -81.16373
#> 3  -81.16373
#> 4  -81.16373
#> 5  -81.16373
#> 6 -104.69910
#>                                                                                                                                                                                                                                             termID
#> 1 obo:BFO_0000020,obo:PPO_0002312,obo:PPO_0002313,obo:PPO_0002314,obo:PPO_0002000,obo:PPO_0002001,obo:BFO_0000001,obo:BFO_0000002,obo:PPO_0002300,obo:PPO_0002024,obo:PPO_0002322,obo:PATO_0000001,obo:PPO_0002014,obo:PPO_0002015,obo:PPO_0002016
#> 2 obo:PATO_0000001,obo:BFO_0000002,obo:BFO_0000001,obo:PPO_0002314,obo:PPO_0002313,obo:PPO_0002312,obo:PPO_0002300,obo:PPO_0002024,obo:PPO_0002001,obo:PPO_0002000,obo:BFO_0000020,obo:PPO_0002322,obo:PPO_0002016,obo:PPO_0002015,obo:PPO_0002014
#> 3 obo:PATO_0000001,obo:PPO_0002322,obo:PPO_0002024,obo:BFO_0000020,obo:PPO_0002014,obo:PPO_0002015,obo:PPO_0002016,obo:PPO_0002000,obo:PPO_0002001,obo:PPO_0002312,obo:PPO_0002313,obo:PPO_0002314,obo:BFO_0000001,obo:BFO_0000002,obo:PPO_0002300
#> 4 obo:PPO_0002024,obo:BFO_0000001,obo:BFO_0000002,obo:PPO_0002001,obo:PPO_0002000,obo:BFO_0000020,obo:PPO_0002300,obo:PATO_0000001,obo:PPO_0002015,obo:PPO_0002016,obo:PPO_0002322,obo:PPO_0002014,obo:PPO_0002314,obo:PPO_0002312,obo:PPO_0002313
#> 5 obo:PPO_0002312,obo:PPO_0002313,obo:PATO_0000001,obo:PPO_0002015,obo:PPO_0002016,obo:PPO_0002014,obo:BFO_0000001,obo:BFO_0000002,obo:PPO_0002000,obo:PPO_0002001,obo:PPO_0002024,obo:BFO_0000020,obo:PPO_0002322,obo:PPO_0002300,obo:PPO_0002314
#> 6 obo:PPO_0002313,obo:PPO_0002312,obo:PPO_0002314,obo:PPO_0002014,obo:PPO_0002016,obo:PPO_0002015,obo:PATO_0000001,obo:PPO_0002322,obo:PPO_0002024,obo:BFO_0000002,obo:BFO_0000001,obo:BFO_0000020,obo:PPO_0002300,obo:PPO_0002000,obo:PPO_0002001
#>    source                                   eventId
#> 1 USA-NPN  urn:phenologicalObservingProcess/7074788
#> 2 USA-NPN urn:phenologicalObservingProcess/17843417
#> 3 USA-NPN urn:phenologicalObservingProcess/17821853
#> 4 USA-NPN urn:phenologicalObservingProcess/17825781
#> 5 USA-NPN urn:phenologicalObservingProcess/17836765
#> 6 USA-NPN  urn:phenologicalObservingProcess/7074796

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