Skip to content

Commit

Permalink
rdoc adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Dec 16, 2024
1 parent f26eabf commit 0a61806
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 20 deletions.
9 changes: 9 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,19 @@ export(SDMXStructureType)
export(SDMXTimeDimension)
export(SDMXType)
export(SDMXUtilityData)
export(addSDMXServiceProvider)
export(findNamespace)
export(findSDMXServiceProvider)
export(getRegistryInterfaceResult)
export(getSDMXServiceProviders)
export(getSoapRequestResult)
export(getStructureType)
export(isRegistryInterfaceEnvelope)
export(isSoapRequestEnvelope)
export(readSDMX)
export(rsdmxLogger)
export(saveSDMX)
export(setSDMXServiceProviders)
import(R6)
import(XML)
import(httr)
Expand Down
19 changes: 11 additions & 8 deletions R/SDMX-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ encodeSDMXOutput <- function(df){

#' @name getNamespaces
#' @docType methods
#' @rdname SDMXStructureType-methods
#' @rdname SDMX-methods
#' @aliases getNamespaces,SDMX-method
#' @title getNamespaces
#' @description Access the namespaces of the SDMX-ML object
Expand All @@ -80,7 +80,7 @@ encodeSDMXOutput <- function(df){
#' @author Emmanuel Blondel, \email{emmanuel.blondel1@@gmail.com}
setGeneric("getNamespaces", function(obj) standardGeneric("getNamespaces"));

#' @rdname SDMXStructureType-methods
#' @rdname SDMX-methods
#' @aliases getNamespaces,SDMX,ANY-method
setMethod(f = "getNamespaces", signature = "SDMX", function(obj){
return(namespaces.SDMX(obj@xmlObj));
Expand Down Expand Up @@ -111,7 +111,8 @@ setMethod(f = "getNamespaces", signature = "SDMX", function(obj){
#' @seealso \link{SDMX-class} \link{getNamespaces}
#'
#' @author Emmanuel Blondel, \email{emmanuel.blondel1@@gmail.com}

#' @export
#'
findNamespace <- function(namespaces, messageType){
regexp <- paste(messageType, "$", sep = "")
ns <- c(ns = namespaces$uri[grep(regexp, namespaces$uri, ignore.case = TRUE)])
Expand All @@ -137,8 +138,8 @@ findNamespace <- function(namespaces, messageType){
#' @seealso \link{SDMX-class} \link{readSDMX}
#'
#' @author Emmanuel Blondel, \email{emmanuel.blondel1@@gmail.com}
#'

#' @export
#'
isSoapRequestEnvelope <- function(xmlObj, namespaces){
return(tolower(xmlName(xmlRoot(xmlObj))) == "envelope")
}
Expand All @@ -160,7 +161,8 @@ isSoapRequestEnvelope <- function(xmlObj, namespaces){
#' @seealso \link{SDMX-class} \link{readSDMX}
#'
#' @author Emmanuel Blondel, \email{emmanuel.blondel1@@gmail.com}

#' @export
#'
getSoapRequestResult <- function(xmlObj){
body <- xmlChildren(xmlRoot(xmlObj))
response <- xmlChildren(body[[1]]); rm(body);
Expand Down Expand Up @@ -188,8 +190,8 @@ getSoapRequestResult <- function(xmlObj){
#' @seealso \link{SDMX-class} \link{readSDMX}
#'
#' @author Emmanuel Blondel, \email{emmanuel.blondel1@@gmail.com}
#' @export
#'

isRegistryInterfaceEnvelope <- function(xmlObj, nativeRoot){
root <- xmlRoot(xmlObj)
if(nativeRoot) root <- root[[1]]
Expand All @@ -213,7 +215,8 @@ isRegistryInterfaceEnvelope <- function(xmlObj, nativeRoot){
#' @seealso \link{SDMX-class} \link{readSDMX}
#'
#' @author Emmanuel Blondel, \email{emmanuel.blondel1@@gmail.com}

#' @export
#'
getRegistryInterfaceResult <- function(xmlObj){
sdmxDoc <- xmlDoc(xmlChildren(xmlRoot(xmlObj))[[1]])
return(sdmxDoc)
Expand Down
6 changes: 3 additions & 3 deletions R/SDMXData-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ addLabels.SDMXData <- function(data, dsd){
#' @author Emmanuel Blondel, \email{emmanuel.blondel1@@gmail.com}
setGeneric("setDSD", function(obj, dsd) standardGeneric("setDSD"));

#' @rdname SDMXStructureType-methods
#' @aliases setDSD,SDMXData,ANY-method
setMethod(f = "setDSD", signature = "SDMXData", function(obj, dsd){
#' @rdname SDMX-methods
#' @aliases setDSD,SDMXData,SDMXDataStructureDefinition-method
setMethod(f = "setDSD", signature = c("SDMXData", "SDMXDataStructureDefinition"), function(obj, dsd){
slot(obj, "dsd") <- dsd
return(obj)
})
11 changes: 7 additions & 4 deletions R/SDMXServiceProvider-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ SDMXServiceProvider <- function(agencyId, name,
#'
#' @seealso \link{getSDMXServiceProviders} \link{addSDMXServiceProvider}
#' \link{findSDMXServiceProvider} \link{readSDMX}
#'
#' @export
#'
setSDMXServiceProviders <- function(){ # nocov start

#international data providers
Expand Down Expand Up @@ -601,7 +602,8 @@ setSDMXServiceProviders <- function(){ # nocov start
#'
#' @seealso \link{getSDMXServiceProviders} \link{findSDMXServiceProvider}
#' \link{readSDMX}
#'
#' @export
#'
addSDMXServiceProvider <- function(provider){
.rsdmx.options$providers <- new("SDMXServiceProviders",
providers = c(slot(.rsdmx.options$providers, "providers"), provider)
Expand All @@ -626,7 +628,8 @@ addSDMXServiceProvider <- function(provider){
#'
#' @seealso \link{addSDMXServiceProvider} \link{findSDMXServiceProvider}
#' \link{readSDMX}
#'
#' @export
#'
getSDMXServiceProviders <- function(){
out <- .rsdmx.options$providers
return(out)
Expand Down Expand Up @@ -656,7 +659,7 @@ getSDMXServiceProviders <- function(){
#'
#' @seealso \link{getSDMXServiceProviders} \link{addSDMXServiceProvider}
#' \link{readSDMX}
#'
#' @export
findSDMXServiceProvider <- function(agencyId){
if(is.null(agencyId)) return(NULL)
res <- unlist(lapply(slot(getSDMXServiceProviders(),"providers"),
Expand Down
4 changes: 2 additions & 2 deletions R/SDMXStructureType-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ type.SDMXStructureType <- function(xmlObj, namespaces, resource){
#generics
#' @export
#' @docType methods
#' @rdname SDMXStructureType-methods
#' @rdname SDMX-methods
setGeneric("getStructureType", function(obj) standardGeneric("getStructureType"));

#methods
#' @rdname SDMXStructureType-methods
#' @rdname SDMX-methods
#' @aliases getStructureType,SDMXStructureType,ANY-method
setMethod(f = "getStructureType", signature = "SDMXStructureType", function(obj){
return(obj@subtype)
Expand Down
5 changes: 2 additions & 3 deletions man/SDMXStructureType-methods.Rd → man/SDMX-methods.Rd

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

0 comments on commit 0a61806

Please sign in to comment.