diff --git a/DESCRIPTION b/DESCRIPTION index 205dc6c..e1fe288 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,7 +34,7 @@ Description: plot.data is an R package for creating client-ready data for variou License: Apache License (= 2.0) Encoding: UTF-8 LazyData: true -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.3 Suggests: covr, testthat (>= 2.1.0) diff --git a/NAMESPACE b/NAMESPACE index 08b7f5d..78145fa 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -119,14 +119,12 @@ exportMethods(pruneLinksByPredicate) exportMethods(relativeRisk) exportMethods(sensitivity) exportMethods(specificity) -exportMethods(toJSON) import(data.table) import(veupathUtils) importFrom(S4Vectors,SimpleList) importFrom(grDevices,nclass.FD) importFrom(grDevices,nclass.Sturges) importFrom(jsonlite,prettify) -importFrom(jsonlite,toJSON) importFrom(jsonlite,unbox) importFrom(lubridate,as_date) importFrom(lubridate,ceiling_date) diff --git a/R/methods-CorrelationLinks.R b/R/methods-CorrelationLinks.R index 57c95fd..8250e08 100644 --- a/R/methods-CorrelationLinks.R +++ b/R/methods-CorrelationLinks.R @@ -78,7 +78,6 @@ function( toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils") -#' @export setMethod(toJSONGeneric, signature("CorrelationLinkList"), function(object, named = c(TRUE, FALSE)) { named <- veupathUtils::matchArg(named) tmp <- veupathUtils::S4SimpleListToJSON(object, FALSE) diff --git a/R/methods-CorrelationNetwork.R b/R/methods-CorrelationNetwork.R index 18209af..27c7f42 100644 --- a/R/methods-CorrelationNetwork.R +++ b/R/methods-CorrelationNetwork.R @@ -63,11 +63,10 @@ function( toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils") #' Convert CorrelationNetwork object to JSON -#' +#' #' Converts a CorrelationNetwork object to JSON #' @param object A CorrelationNetwork object #' @param named boolean that declares if names should be included -#' @export setMethod(toJSONGeneric, "CorrelationNetwork", function(object, named = c(TRUE, FALSE)) { named <- veupathUtils::matchArg(named) diff --git a/R/methods-KPartiteNetwork.R b/R/methods-KPartiteNetwork.R index 0bc7769..190ce6f 100644 --- a/R/methods-KPartiteNetwork.R +++ b/R/methods-KPartiteNetwork.R @@ -13,11 +13,10 @@ setMethod("getAllNodeIds", "Partitions", function(object) unlist(lapply(as.list( toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils") #' Convert Partitions object to JSON -#' +#' #' Converts a Partitions object to JSON #' @param object A Partitions object #' @param named boolean that declares if names should be included -#' @export setMethod(toJSONGeneric, "Partitions", function(object, named = c(TRUE, FALSE)) { named <- veupathUtils::matchArg(named) tmp <- veupathUtils::S4SimpleListToJSON(object, TRUE) @@ -28,11 +27,10 @@ setMethod(toJSONGeneric, "Partitions", function(object, named = c(TRUE, FALSE)) }) #' Convert KPartiteNetwork object to JSON -#' +#' #' Converts a KPartiteNetwork object to JSON #' @param object A KPartiteNetwork object #' @param named boolean that declares if names should be included -#' @export setMethod(toJSONGeneric, "KPartiteNetwork", function(object, named = c(TRUE, FALSE)) { named <- veupathUtils::matchArg(named) tmp <- character() diff --git a/R/methods-Links.R b/R/methods-Links.R index 57d9b7a..e3bb62f 100644 --- a/R/methods-Links.R +++ b/R/methods-Links.R @@ -40,11 +40,10 @@ setMethod("getColors", "LinkList", function(object) unlist(lapply(object, functi toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils") #' Convert Link object to JSON -#' +#' #' Converts a Link object to JSON #' @param object A Link object #' @param named boolean that declares if names should be included -#' @export setMethod(toJSONGeneric, "Link", function(object, named = c(FALSE, TRUE)) { named <- veupathUtils::matchArg(named) tmp <- character() @@ -63,7 +62,6 @@ setMethod(toJSONGeneric, "Link", function(object, named = c(FALSE, TRUE)) { return(tmp) }) -#' @export setMethod(toJSONGeneric, signature("LinkList"), function(object, named = c(TRUE, FALSE)) { named <- veupathUtils::matchArg(named) tmp <- veupathUtils::S4SimpleListToJSON(object, FALSE) diff --git a/R/methods-Network.R b/R/methods-Network.R index 55327f1..4ce8a25 100644 --- a/R/methods-Network.R +++ b/R/methods-Network.R @@ -172,11 +172,10 @@ pruneLinksBelowWeight <- function(net, threshold, verbose = c(TRUE, FALSE)) { toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils") #' Convert Network object to JSON -#' +#' #' Converts a Network object to JSON #' @param object A Network object #' @param named boolean that declares if names should be included -#' @export setMethod(toJSONGeneric, "BaseNetwork", function(object, named = c(TRUE, FALSE)) { named <- veupathUtils::matchArg(named) @@ -202,7 +201,6 @@ setMethod(toJSONGeneric, "BaseNetwork", function(object, named = c(TRUE, FALSE)) #' @param pattern optional tmp file prefix #' @param verbose boolean that declares if logging is desired #' @return character name of a tmp file w ext *.json -#' @importFrom jsonlite toJSON #' @export #' @rdname writeNetworkJSON setGeneric("writeNetworkJSON", function(x, pattern = NULL, verbose = c(TRUE, FALSE)) standardGeneric("writeNetworkJSON"), signature = c("x")) diff --git a/R/methods-Nodes.R b/R/methods-Nodes.R index 204d45f..b5cc9ea 100644 --- a/R/methods-Nodes.R +++ b/R/methods-Nodes.R @@ -58,11 +58,10 @@ setMethod("getNodeIds", "NodeIdList", function(object) unlist(lapply(as.list(obj toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils") #' Convert Node object to JSON -#' +#' #' Converts a Node object to JSON #' @param object A Node object #' @param named boolean that declares if names should be included -#' @export setMethod(toJSONGeneric, "Node", function(object, named = c(FALSE, TRUE)) { named <- veupathUtils::matchArg(named) tmp <- character() @@ -82,7 +81,6 @@ setMethod(toJSONGeneric, "Node", function(object, named = c(FALSE, TRUE)) { return(tmp) }) -#' @export setMethod(toJSONGeneric, signature("NodeList"), function(object, named = c(TRUE, FALSE)) { named <- veupathUtils::matchArg(named) tmp <- veupathUtils::S4SimpleListToJSON(object, FALSE) @@ -92,7 +90,6 @@ setMethod(toJSONGeneric, signature("NodeList"), function(object, named = c(TRUE, return(tmp) }) -#' @export setMethod(toJSONGeneric, signature("NodeId"), function(object, named = c(FALSE, TRUE)) { named <- veupathUtils::matchArg(named) tmp <- character() @@ -104,7 +101,6 @@ setMethod(toJSONGeneric, signature("NodeId"), function(object, named = c(FALSE, return(tmp) }) -#' @export setMethod(toJSONGeneric, signature("NodeIdList"), function(object, named = c(TRUE, FALSE)) { named <- veupathUtils::matchArg(named) tmp <- veupathUtils::S4SimpleListToJSON(object, FALSE) diff --git a/R/utils-json.R b/R/utils-json.R index c9264f3..3f43240 100644 --- a/R/utils-json.R +++ b/R/utils-json.R @@ -257,7 +257,6 @@ getJSON <- function(.pd, evilMode) { #' @param .pd a data.table to convert to json and write to a tmp file #' @param pattern optional tmp file prefix #' @return character name of a tmp file w ext *.json -#' @importFrom jsonlite toJSON #' @importFrom jsonlite prettify #' @export writeJSON <- function(.pd, evilMode, pattern = NULL, verbose = c(TRUE, FALSE)) {