Skip to content
Browse files

changed fxn names to have subscript abbrev to each

  • Loading branch information...
1 parent 352e1cf commit 60a787d52a1701d75eeb038be9632ae1222fcc13 @sckott sckott committed Sep 8, 2012
View
12 DESCRIPTION
@@ -12,9 +12,9 @@ URL: https://github.com/ropensci/rpmc
Imports:
OAIHarvester
Collate:
- 'getrecord.R'
- 'identify.R'
- 'listidentifiers.R'
- 'listmetadataformats.R'
- 'listrecords.R'
- 'listsets.R'
+ 'pmc_getrecord.R'
+ 'pmc_identify.R'
+ 'pmc_listidentifiers.R'
+ 'pmc_listmetadataformats.R'
+ 'pmc_listrecords.R'
+ 'pmc_listsets.R'
View
12 NAMESPACE
@@ -1,7 +1,7 @@
-export(getrecord)
-export(identify)
-export(listidentifiers)
-export(listmetadataformats)
-export(listrecords)
-export(listsets)
+export(pmc_getrecord)
+export(pmc_identify)
+export(pmc_listidentifiers)
+export(pmc_listmetadataformats)
+export(pmc_listrecords)
+export(pmc_listsets)
import(OAIHarvester)
View
8 R/getrecord.R → R/pmc_getrecord.R
@@ -1,20 +1,20 @@
#' Retrieve an individual record from the PubMed Central repository.
#'
#' @import OAIHarvester
-#' @inheritParams listmetadataformats
+#' @inheritParams pmc_listmetadataformats
#' @param prefix The prefix to use, one of: "oa_dc" (Dublin Core metadata format),
#' "pmc_fm" (PMC front matter metadata format), or "pmc"
#' (full text for open access content only)
#' @examples \dontrun{
-#' out <- getrecord(152494, T)
+#' out <- pmc_getrecord(152494, T)
#' out$metadata # get $identifier, $datestamp, $setSpec, or $metadata
#' oaih_transform(out$metadata) # transform only metadata to a list
#'
#' # Full text
-#' getrecord(156895, T, "pmc")
+#' pmc_getrecord(156895, T, "pmc")
#' }
#' @export
-getrecord <- function(id = NULL, transform = TRUE, prefix = "oai_dc",
+pmc_getrecord <- function(id = NULL, transform = TRUE, prefix = "oai_dc",
url = "http://www.pubmedcentral.gov/oai/oai.cgi")
{
if(!is.null(id) == T) {oaiid <- paste("oai:pubmedcentral.nih.gov:", id, sep="")} else
View
6 R/identify.R → R/pmc_identify.R
@@ -1,12 +1,12 @@
#' Learn about the PubMed Central OAI-PMH service.
#'
#' @import OAIHarvester
-#' @inheritParams listmetadataformats
+#' @inheritParams pmc_listmetadataformats
#' @export
#' @examples \dontrun{
-#' identify()
+#' pmc_identify()
#' }
-identify <- function(transform = TRUE, url = "http://www.pubmedcentral.gov/oai/oai.cgi")
+pmc_identify <- function(transform = TRUE, url = "http://www.pubmedcentral.gov/oai/oai.cgi")
{
oaih_identify(url, transform = transform)
}
View
6 R/listidentifiers.R → R/pmc_listidentifiers.R
@@ -11,12 +11,12 @@
#' (full text for open access content only)
#' @param token a token previously provided by the server to resume a request
#' where it last left off.
-#' @inheritParams listmetadataformats
+#' @inheritParams pmc_listmetadataformats
#' @export
#' @examples \dontrun{
-#' listidentifiers(from = '2012-07-26')
+#' pmc_listidentifiers(from = '2012-07-26')
#' }
-listidentifiers <- function(from = NULL, until = NULL, set = NULL,
+pmc_listidentifiers <- function(from = NULL, until = NULL, set = NULL,
prefix = 'oai_dc', token = NULL, transform = TRUE,
url = "http://www.pubmedcentral.gov/oai/oai.cgi")
{
View
6 R/listmetadataformats.R → R/pmc_listmetadataformats.R
@@ -6,10 +6,10 @@
#' @param url the base url for DataCite (leave to default)
#' @export
#' @examples \dontrun{
-#' listmetadataformats() # list all possible metadata formats for PMC
-#' listmetadataformats("56225") # possible metadata formats for specific identifier
+#' pmc_listmetadataformats() # list all possible metadata formats for PMC
+#' pmc_listmetadataformats("56225") # possible metadata formats for specific identifier
#' }
-listmetadataformats <- function(id = NULL, transform = TRUE,
+pmc_listmetadataformats <- function(id = NULL, transform = TRUE,
url = "http://www.pubmedcentral.gov/oai/oai.cgi")
{
if(!is.null(id) == T) {oaiid <- paste("oai:pubmedcentral.nih.gov:", id, sep="")} else
View
6 R/listrecords.R → R/pmc_listrecords.R
@@ -1,12 +1,12 @@
#' List the records in the PubMed Central metadata repository.
#'
#' @import OAIHarvester
-#' @inheritParams listidentifiers
+#' @inheritParams pmc_listmetadataformats
#' @param prefix The prefix to use, one of: "oa_dc" (Dublin Core metadata format),
#' "pmc_fm" (PMC front matter metadata format), or "pmc"
#' (full text for open access content only)
#' @examples \dontrun{
-#' out <- listrecords(from = '2001-03-22', until = '2001-03-22', transform=T)
+#' out <- pmc_listrecords(from = '2001-03-22', until = '2001-03-22', transform=T)
#' nrow(out) # number of records
#' out[3,] # a single record
#'
@@ -16,7 +16,7 @@
#' oaih_transform(mout[[1]]) # convert XML to a list
#' }
#' @export
-listrecords <- function(from = NULL, until = NULL, set = NULL, prefix = 'oai_dc',
+pmc_listrecords <- function(from = NULL, until = NULL, set = NULL, prefix = 'oai_dc',
token = NULL, transform = TRUE,
url = "http://www.pubmedcentral.gov/oai/oai.cgi")
{
View
6 R/listsets.R → R/pmc_listsets.R
@@ -1,14 +1,14 @@
#' Retrieve the set structure of DataCite, useful for selective harvesting.
#'
#' @import OAIHarvester
-#' @inheritParams listmetadataformats
+#' @inheritParams pmc_listmetadataformats
#' @examples \dontrun{
-#' out <- listsets()
+#' out <- pmc_listsets()
#' nrow(out); head(out)
#' out[nrow(out),]
#' }
#' @export
-listsets <- function(url = "http://www.pubmedcentral.gov/oai/oai.cgi")
+pmc_listsets <- function(url = "http://www.pubmedcentral.gov/oai/oai.cgi")
{
out <- oaih_list_sets(url, transform = FALSE)
data.frame(
View
11 man/getrecord.Rd → man/pmc_getrecord.Rd
@@ -1,8 +1,9 @@
-\name{getrecord}
-\alias{getrecord}
+\name{pmc_getrecord}
+\alias{pmc_getrecord}
\title{Retrieve an individual record from the PubMed Central repository.}
\usage{
- getrecord(id = NULL, transform = TRUE, prefix = "oai_dc",
+ pmc_getrecord(id = NULL, transform = TRUE,
+ prefix = "oai_dc",
url = "http://www.pubmedcentral.gov/oai/oai.cgi")
}
\arguments{
@@ -23,12 +24,12 @@
}
\examples{
\dontrun{
-out <- getrecord(152494, T)
+out <- pmc_getrecord(152494, T)
out$metadata # get $identifier, $datestamp, $setSpec, or $metadata
oaih_transform(out$metadata) # transform only metadata to a list
# Full text
-getrecord(156895, T, "pmc")
+pmc_getrecord(156895, T, "pmc")
}
}
View
8 man/identify.Rd → man/pmc_identify.Rd
@@ -1,8 +1,8 @@
-\name{identify}
-\alias{identify}
+\name{pmc_identify}
+\alias{pmc_identify}
\title{Learn about the PubMed Central OAI-PMH service.}
\usage{
- identify(transform = TRUE,
+ pmc_identify(transform = TRUE,
url = "http://www.pubmedcentral.gov/oai/oai.cgi")
}
\arguments{
@@ -15,7 +15,7 @@
}
\examples{
\dontrun{
-identify()
+pmc_identify()
}
}
View
11 man/listidentifiers.Rd → man/pmc_listidentifiers.Rd
@@ -1,9 +1,10 @@
-\name{listidentifiers}
-\alias{listidentifiers}
+\name{pmc_listidentifiers}
+\alias{pmc_listidentifiers}
\title{Retrieve record headers from the PubMed Central repository.}
\usage{
- listidentifiers(from = NULL, until = NULL, set = NULL,
- prefix = "oai_dc", token = NULL, transform = TRUE,
+ pmc_listidentifiers(from = NULL, until = NULL,
+ set = NULL, prefix = "oai_dc", token = NULL,
+ transform = TRUE,
url = "http://www.pubmedcentral.gov/oai/oai.cgi")
}
\arguments{
@@ -34,7 +35,7 @@
}
\examples{
\dontrun{
-listidentifiers(from = '2012-07-26')
+pmc_listidentifiers(from = '2012-07-26')
}
}
View
10 man/listmetadataformats.Rd → man/pmc_listmetadataformats.Rd
@@ -1,8 +1,8 @@
-\name{listmetadataformats}
-\alias{listmetadataformats}
+\name{pmc_listmetadataformats}
+\alias{pmc_listmetadataformats}
\title{List available metadata formats that the PubMed Central repository can disseminate.}
\usage{
- listmetadataformats(id = NULL, transform = TRUE,
+ pmc_listmetadataformats(id = NULL, transform = TRUE,
url = "http://www.pubmedcentral.gov/oai/oai.cgi")
}
\arguments{
@@ -18,8 +18,8 @@
}
\examples{
\dontrun{
-listmetadataformats() # list all possible metadata formats for PMC
-listmetadataformats("56225") # possible metadata formats for specific identifier
+pmc_listmetadataformats() # list all possible metadata formats for PMC
+pmc_listmetadataformats("56225") # possible metadata formats for specific identifier
}
}
View
20 man/listrecords.Rd → man/pmc_listrecords.Rd
@@ -1,8 +1,8 @@
-\name{listrecords}
-\alias{listrecords}
+\name{pmc_listrecords}
+\alias{pmc_listrecords}
\title{List the records in the PubMed Central metadata repository.}
\usage{
- listrecords(from = NULL, until = NULL, set = NULL,
+ pmc_listrecords(from = NULL, until = NULL, set = NULL,
prefix = "oai_dc", token = NULL, transform = TRUE,
url = "http://www.pubmedcentral.gov/oai/oai.cgi")
}
@@ -12,18 +12,6 @@
metadata format), or "pmc" (full text for open access
content only)}
- \item{from}{specifies that records returned must have
- been created/update/deleted on or after this date.}
-
- \item{until}{specifies that records returned must have
- been created/update/deleted on or before this date.}
-
- \item{set}{specifies the set that returned records must
- belong to.}
-
- \item{token}{a token previously provided by the server to
- resume a request where it last left off.}
-
\item{transform}{transform metadata to list (TRUE/FALSE)}
\item{url}{the base url for DataCite (leave to default)}
@@ -34,7 +22,7 @@
}
\examples{
\dontrun{
-out <- listrecords(from = '2001-03-22', until = '2001-03-22', transform=T)
+out <- pmc_listrecords(from = '2001-03-22', until = '2001-03-22', transform=T)
nrow(out) # number of records
out[3,] # a single record
View
8 man/listsets.Rd → man/pmc_listsets.Rd
@@ -1,8 +1,8 @@
-\name{listsets}
-\alias{listsets}
+\name{pmc_listsets}
+\alias{pmc_listsets}
\title{Retrieve the set structure of DataCite, useful for selective harvesting.}
\usage{
- listsets(url = "http://www.pubmedcentral.gov/oai/oai.cgi")
+ pmc_listsets(url = "http://www.pubmedcentral.gov/oai/oai.cgi")
}
\arguments{
\item{url}{the base url for DataCite (leave to default)}
@@ -13,7 +13,7 @@
}
\examples{
\dontrun{
-out <- listsets()
+out <- pmc_listsets()
nrow(out); head(out)
out[nrow(out),]
}

0 comments on commit 60a787d

Please sign in to comment.
Something went wrong with that request. Please try again.