From c9968e747d0b99e27ad52c8abf3706de1552f985 Mon Sep 17 00:00:00 2001 From: Renaud Date: Tue, 2 May 2023 17:22:10 +0200 Subject: [PATCH] Remove implicit dependency to AnnotationDbi Not required and caused spurious warnings in package loading --- R/devutils.R | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/R/devutils.R b/R/devutils.R index c39ae7d..d5bfad0 100644 --- a/R/devutils.R +++ b/R/devutils.R @@ -8,44 +8,7 @@ #' @include namespace.R NULL -# taken from AnnotationDbi -make.name.tree <- function (x, recursive, what.names) -{ - if (!is.character(what.names) || length(what.names) != 1) - stop("'what.names' must be a single string") - what.names <- match.arg(what.names, c("inherited", "full")) - .make.name.tree.rec <- function(x, parent_name, depth) { - if (length(x) == 0) - return(character(0)) - x_names <- names(x) - if (is.null(x_names)) - x_names <- rep.int(parent_name, length(x)) - else if (what.names == "full") - x_names <- paste0(parent_name, x_names) - else x_names[x_names == ""] <- parent_name - if (!is.list(x) || (!recursive && depth >= 1L)) - return(x_names) - if (what.names == "full") - x_names <- paste0(x_names, ".") - lapply(seq_len(length(x)), function(i) .make.name.tree.rec(x[[i]], - x_names[i], depth + 1L)) - } - .make.name.tree.rec(x, "", 0L) -} - -.unlist2 <- function (x, recursive = TRUE, use.names = TRUE, what.names = "inherited") -{ - ans <- unlist(x, recursive, FALSE) - if (!use.names) - return(ans) - if (!is.character(what.names) || length(what.names) != 1) - stop("'what.names' must be a single string") - what.names <- match.arg(what.names, c("inherited", "full")) - names(ans) <- unlist(make.name.tree(x, recursive, what.names), - recursive, FALSE) - ans -} -unlist2 <- ns_get('AnnotationDbi::unlist2') %||% .unlist2 +unlist2 <- unlist_ set_libPaths <- function(lib.loc=NULL){ ol <- Sys.getenv('R_LIBS')