Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed parameters without definitions, other edits

  • Loading branch information...
commit b5ef041a42513fa2817ced09289bc15937ad9a74 1 parent 03e9957
@sckott sckott authored
View
5 DESCRIPTION
@@ -5,7 +5,7 @@ Description: A programmatic interface to the
Title: Interface to the Global Biodiversity Information Facility API methods
Version: 0.1
License: CC0
-Date: 2012-3-20
+Date: 2012-3-21
Authors@R: c(person("Scott", "Chamberlain", role = c("aut", "cre"),
email = "myrmecocystus@gmail.com"),
person("Carl", "Boettiger", role = "aut",
@@ -14,9 +14,8 @@ Authors@R: c(person("Scott", "Chamberlain", role = c("aut", "cre"),
email = "karthik.ram@gmail.com"))
Imports:
XML,
- RJSONIO,
RCurl (>= 1.6),
- stringr
+ plyr
Collate:
'gbifdatause.R'
'occurrenceget.R'
View
6 R/gbifdatause.R
@@ -1,13 +1,11 @@
#' gbifdatause - description
#' @import RCurl
-#' @param None
+#' @param url Base url for call, don't change.
#' @export
#' @examples \dontrun{
#' gbifdatause()
#' }
-gbifdatause <- function(url = 'http://data.gbif.org/tutorial/datasharingagreement',
- ...,
- curl = getCurlHandle() )
+gbifdatause <- function(url = 'http://data.gbif.org/tutorial/datasharingagreement')
{
getURLContent(url)
}
View
4 R/networks.r
@@ -7,6 +7,10 @@
#' @param name data network name search string, by default searches all
#' data networks by defining name = ""
#' @param maxresults max number of results to return
+#' @param url the base GBIF API url for the function (should be left to default)
+#' @param ... optional additional curl options (debugging tools mostly)
+#' @param curl If using in a loop, call getCurlHandle() first and pass
+#' the returned value in here (avoids unnecessary footprint)
#' @export
#' @examples \dontrun{
#' # Test the function for a few networks
View
7 R/occurrenceget.R
@@ -1,7 +1,6 @@
#' occurrenceget - description
#' @import RCurl XML
#' @param key numeric key uniquely identifying the occurrence record within the GBIF
-#' @param stylesheet sets the URL of the stylesheet to be associated with the response document
#' @param format specifies the format in which the records are to be returned, one of: brief, darwin or kml (character)
#' @param mode specifies whether the response data should (as far as possible) be the raw values originally retrieved from the data resource or processed (normalised) values used within the data portal (character)
#' @param url the base GBIF API url for the function (should be left to default)
@@ -12,20 +11,18 @@
#' @examples \dontrun{
#' occurrenceget(key = 13749100)
#' }
-occurrenceget <- function(key = NA, style = NA, format = NA, mode = NA,
+occurrenceget <- function(key = NA, format = NA, mode = NA,
url = 'http://data.gbif.org/ws/rest/occurrence/get?',
...,
curl = getCurlHandle())
{
if(!is.na(key)) {key2 <- paste('key=', key, sep='')} else
{key2 <- NULL}
- if(!is.na(style)) {style2 <- paste('stylesheet=', style, sep='')} else
- {style2 <- NULL}
if(!is.na(format)) {format2 <- paste('format=', format, sep='')} else
{format2 <- NULL}
if(!is.na(mode)) {mode2 <- paste('mode=', mode, sep='')} else
{mode2 <- NULL}
- args <- paste(key2, style2, format2, mode2, sep='&')
+ args <- paste(key2, format2, mode2, sep='&')
query <- paste(url, args, sep='')
tt <- getURL(query,
...,
View
4 R/providers.r
@@ -7,6 +7,10 @@
#' @param name data provider name search string, by default searches all
#' data providers by defining name = ""
#' @param maxresults max number of results to return
+#' @param url the base GBIF API url for the function (should be left to default)
+#' @param ... optional additional curl options (debugging tools mostly)
+#' @param curl If using in a loop, call getCurlHandle() first and pass
+#' the returned value in here (avoids unnecessary footprint)
#' @export
#' @examples \dontrun{
#' # Test the function for a few providers
View
4 R/resources.r
@@ -7,6 +7,10 @@
#' @param name data provider name search string, by default searches all
#' data resources by defining name = ""
#' @param maxresults max number of results to return
+#' @param url the base GBIF API url for the function (should be left to default)
+#' @param ... optional additional curl options (debugging tools mostly)
+#' @param curl If using in a loop, call getCurlHandle() first and pass
+#' the returned value in here (avoids unnecessary footprint)
#' @export
#' @examples \dontrun{
#' # Test the function for a few resources
View
11 R/taxoncount.R
@@ -2,8 +2,8 @@
#' @import RCurl XML
#' @param sciname scientitic name of taxon (character, see example)
#' @param rank rank of taxon, see taxrank() (character)
-#' @param dataproviderkey Filter records to those provided by the supplied
-#' numeric key for a data provider. See provider(). (character)
+#' @param dataresourcekey Filter records to those provided by the supplied
+#' numeric key for a data resource. See resources(). (character)
#' @param url the base GBIF API url for the function (should be left to default)
#' @param ... optional additional curl options (debugging tools mostly)
#' @param curl If using in a loop, call getCurlHandle() first and pass
@@ -12,10 +12,9 @@
#' @examples \dontrun{
#' taxoncount("Puma concolor")
#' taxoncount("Helianthus annuus")
-#' taxoncount(rank = "family", datakey = 12)
#' taxoncount(rank = "family")
#' }
-taxoncount <- function(sciname = NULL, rank = NULL, dataproviderkey = NULL,
+taxoncount <- function(sciname = NULL, rank = NULL, dataresourcekey = NULL,
url = 'http://data.gbif.org/ws/rest/taxon/count?',
...,
curl = getCurlHandle() )
@@ -26,8 +25,8 @@ taxoncount <- function(sciname = NULL, rank = NULL, dataproviderkey = NULL,
if(!is.null(rank)){
rank2 <- paste("rank=", rank, sep = "")} else
{rank2 <- NULL}
- if(!is.null(datakey)){
- datakey2 <- paste("dataresourcekey=", datakey, sep = "")} else
+ if(!is.null(dataresourcekey)){
+ datakey2 <- paste("dataresourcekey=", dataresourcekey, sep = "")} else
{datakey2 <- NULL}
args <- paste(sciname2, rank2, datakey2, sep = "&")
url2 <- paste(url, args, sep = "")
View
1  R/taxrank.r
@@ -1,5 +1,4 @@
#' Get values to be used for (taxonomic) rank arguments in GBIF API methods.
-#' @param None
#' @export
#' @examples \dontrun{
#' taxrank()
View
5 man/gbifdatause.Rd
@@ -2,11 +2,10 @@
\alias{gbifdatause}
\title{gbifdatause - description}
\usage{
- gbifdatause(url = "http://data.gbif.org/tutorial/datasharingagreement",
- ..., curl = getCurlHandle())
+ gbifdatause(url = "http://data.gbif.org/tutorial/datasharingagreement")
}
\arguments{
- \item{None}{}
+ \item{url}{Base url for call, don't change.}
}
\description{
gbifdatause - description
View
45 man/getoccurrence.Rd
@@ -1,45 +0,0 @@
-\name{getoccurrence}
-\alias{getoccurrence}
-\title{getoccurrence - description}
-\usage{
- getoccurrence(key = NA, style = NA, format = NA,
- mode = NA,
- url = "http://data.gbif.org/ws/rest/occurrence/get?",
- ..., curl = getCurlHandle())
-}
-\arguments{
- \item{key}{numeric key uniquely identifying the
- occurrence record within the GBIF}
-
- \item{stylesheet}{sets the URL of the stylesheet to be
- associated with the response document}
-
- \item{format}{specifies the format in which the records
- are to be returned, one of: brief, darwin or kml
- (character)}
-
- \item{mode}{specifies whether the response data should
- (as far as possible) be the raw values originally
- retrieved from the data resource or processed
- (normalised) values used within the data portal
- (character)}
-
- \item{url}{the base GBIF API url for the function (should
- be left to default)}
-
- \item{...}{optional additional curl options (debugging
- tools mostly)}
-
- \item{curl}{If using in a loop, call getCurlHandle()
- first and pass the returned value in here (avoids
- unnecessary footprint)}
-}
-\description{
- getoccurrence - description
-}
-\examples{
-\dontrun{
-getoccurrence(key = 13749100)
-}
-}
-
View
10 man/networks.Rd
@@ -11,6 +11,16 @@
searches all data networks by defining name = ""}
\item{maxresults}{max number of results to return}
+
+ \item{url}{the base GBIF API url for the function (should
+ be left to default)}
+
+ \item{...}{optional additional curl options (debugging
+ tools mostly)}
+
+ \item{curl}{If using in a loop, call getCurlHandle()
+ first and pass the returned value in here (avoids
+ unnecessary footprint)}
}
\description{
Beware: It takes a while to retrieve the full list of
View
6 man/occurrenceget.Rd
@@ -2,8 +2,7 @@
\alias{occurrenceget}
\title{occurrenceget - description}
\usage{
- occurrenceget(key = NA, style = NA, format = NA,
- mode = NA,
+ occurrenceget(key = NA, format = NA, mode = NA,
url = "http://data.gbif.org/ws/rest/occurrence/get?",
..., curl = getCurlHandle())
}
@@ -11,9 +10,6 @@
\item{key}{numeric key uniquely identifying the
occurrence record within the GBIF}
- \item{stylesheet}{sets the URL of the stylesheet to be
- associated with the response document}
-
\item{format}{specifies the format in which the records
are to be returned, one of: brief, darwin or kml
(character)}
View
10 man/providers.Rd
@@ -11,6 +11,16 @@
searches all data providers by defining name = ""}
\item{maxresults}{max number of results to return}
+
+ \item{url}{the base GBIF API url for the function (should
+ be left to default)}
+
+ \item{...}{optional additional curl options (debugging
+ tools mostly)}
+
+ \item{curl}{If using in a loop, call getCurlHandle()
+ first and pass the returned value in here (avoids
+ unnecessary footprint)}
}
\description{
Beware: It takes a while to retrieve the full list of
View
29 man/rank.Rd
@@ -1,29 +0,0 @@
-\name{rank}
-\alias{rank}
-\title{Get values to be used for rank arguments in GBIF API methods.}
-\usage{
- rank()
-
- rank()
-}
-\arguments{
- \item{None}{}
-
- \item{None}{}
-}
-\description{
- Get values to be used for rank arguments in GBIF API
- methods.
-
- Get values to be used for rank arguments in GBIF API
- methods.
-}
-\examples{
-\dontrun{
-rank()
-}
-\dontrun{
-rank()
-}
-}
-
View
10 man/resources.Rd
@@ -11,6 +11,16 @@
searches all data resources by defining name = ""}
\item{maxresults}{max number of results to return}
+
+ \item{url}{the base GBIF API url for the function (should
+ be left to default)}
+
+ \item{...}{optional additional curl options (debugging
+ tools mostly)}
+
+ \item{curl}{If using in a loop, call getCurlHandle()
+ first and pass the returned value in here (avoids
+ unnecessary footprint)}
}
\description{
Beware: It takes a while to retrieve the full list of
View
9 man/taxoncount.Rd
@@ -3,7 +3,7 @@
\title{Search by taxon to retrieve number of records in GBIF.}
\usage{
taxoncount(sciname = NULL, rank = NULL,
- dataproviderkey = NULL,
+ dataresourcekey = NULL,
url = "http://data.gbif.org/ws/rest/taxon/count?", ...,
curl = getCurlHandle())
}
@@ -13,9 +13,9 @@
\item{rank}{rank of taxon, see taxrank() (character)}
- \item{dataproviderkey}{Filter records to those provided
- by the supplied numeric key for a data provider. See
- provider(). (character)}
+ \item{dataresourcekey}{Filter records to those provided
+ by the supplied numeric key for a data resource. See
+ resources(). (character)}
\item{url}{the base GBIF API url for the function (should
be left to default)}
@@ -34,7 +34,6 @@
\dontrun{
taxoncount("Puma concolor")
taxoncount("Helianthus annuus")
-taxoncount(rank = "family", datakey = 12)
taxoncount(rank = "family")
}
}
View
3  man/taxrank.Rd
@@ -4,9 +4,6 @@
\usage{
taxrank()
}
-\arguments{
- \item{None}{}
-}
\description{
Get values to be used for (taxonomic) rank arguments in
GBIF API methods.
Please sign in to comment.
Something went wrong with that request. Please try again.