Skip to content

Commit

Permalink
fix NAMESPACE issues
Browse files Browse the repository at this point in the history
  • Loading branch information
leeper committed Jun 12, 2017
1 parent cdcbb77 commit dac6775
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ matrix:

r_packages:
- covr
- knitr

after_success:
- if [[ "${R_CODECOV}" ]]; then R -e 'covr::codecov()'; fi
Expand Down
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Authors@R: c(person("Thomas J.", "Leeper", role = c("aut", "cre"),
person("Jan", "Kanis", role = "ctb"))
Maintainer: Thomas J. Leeper <[email protected]>
Imports:
stats,
utils,
httr,
XML,
Expand All @@ -23,4 +24,5 @@ Description: Provides access to Dataverse version 4 APIs, enabling data search,
License: GPL-2
URL: https://github.com/iqss/dataverse-client-r
BugReports: https://github.com/iqss/dataverse-client-r/issues
VignetteBuilder: knitr
RoxygenNote: 6.0.1
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ export(service_document)
export(set_dataverse_metadata)
export(update_dataset)
export(update_group)
importFrom(stats,setNames)
importFrom(utils,str)
importFrom(utils,unzip)
importFrom(xml2,read_xml)
3 changes: 2 additions & 1 deletion R/SWORD.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' # list available datasets in first dataverse
#' list_datasets(d[[2]])
#' }
#' @importFrom stats setNames
#' @export
service_document <- function(key = Sys.getenv("DATAVERSE_KEY"), server = Sys.getenv("DATAVERSE_SERVER"), ...) {
u <- paste0(api_url(server, prefix="dvn/api/"), "data-deposit/v1.1/swordv2/service-document")
Expand All @@ -35,7 +36,7 @@ service_document <- function(key = Sys.getenv("DATAVERSE_KEY"), server = Sys.get
s$alias <- strsplit(s$url, "/collection/dataverse/")[[1]][2]
out[[length(out) + 1]] <- s
}
out <- setNames(out, `[<-`(names(out), n, "dataverse"))
out <- stats::setNames(out, `[<-`(names(out), n, "dataverse"))
structure(out, class = "sword_service_document")
}

Expand Down
1 change: 1 addition & 0 deletions R/dataset_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#' # get metadata
#' str(dataset_metadata(d1), 4)
#' }
#' @importFrom utils str
#' @export
dataset_metadata <- function(dataset, version = ":latest", block = "citation", key = Sys.getenv("DATAVERSE_KEY"), server = Sys.getenv("DATAVERSE_SERVER"), ...) {
dataset <- dataset_id(dataset)
Expand Down
2 changes: 1 addition & 1 deletion R/dataverse_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @param per_page An integer specifying the page size of results.
#' @param start An integer specifying used for pagination.
#' @param show_relevance A logical indicating whether or not to show details of which fields were matched by the query
#' @param show_facets A logical indicating whether or not to show facets that can be operated on by the “fq” parameter
#' @param show_facets A logical indicating whether or not to show facets that can be operated on by the \code{fq} parameter
#' @param fq See API documentation.
#' @template envvars
#' @param verbose A logical indicating whether to display information about the search query (default is \code{TRUE}).
Expand Down
1 change: 1 addition & 0 deletions R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ print.dataverse <- function(x, ...) {
}

# dataverse_dataset class
#' @importFrom utils str
#' @export
print.dataverse_dataset <- function(x, ...) {
cat("Dataset (", x$id, "): ", x$persistentUrl, "\n", sep = "")
Expand Down
2 changes: 1 addition & 1 deletion R/utils_atom.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ print.dataset_atom <- function(x, ...) {
parse_atom <- function(xml){
xmllist <- XML::xmlToList(xml)
links <- lapply(xmllist[names(xmllist) == "link"], function(x) as.vector(x[1]))
links <- setNames(links, sapply(xmllist[names(xmllist) == "link"], `[`, 2))
links <- stats::setNames(links, sapply(xmllist[names(xmllist) == "link"], `[`, 2))
names(links)[grep("statement$", names(links))] <- "statement"
names(links)[grep("add$", names(links))] <- "add"
xmlout <- list(id = xmllist$id,
Expand Down
2 changes: 1 addition & 1 deletion man/dataverse_search.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dac6775

Please sign in to comment.