Skip to content

Commit

Permalink
Remove implicit dependency to AnnotationDbi
Browse files Browse the repository at this point in the history
Not required and caused spurious warnings in package loading
  • Loading branch information
renozao committed May 2, 2023
1 parent 4d4d93a commit c9968e7
Showing 1 changed file with 1 addition and 38 deletions.
39 changes: 1 addition & 38 deletions R/devutils.R
Expand Up @@ -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')
Expand Down

0 comments on commit c9968e7

Please sign in to comment.