[Bioc-devel] ddply causes error during R check
web working
webwork|ng @end|ng |rom po@teo@de
Tue Feb 12 08:33:27 CET 2019
Hi,
I am developing a Bioconductor package and can not get rid of some
warning messages. During devtools::check() I get the following warning
messages:
...
summarizeDataFrame: no visible binding for global variable ‘name’
summarizeDataFrame: no visible binding for global variable ‘gene’
summarizeDataFrame: no visible binding for global variable ‘value’
...
Here a short version of the function:
#' Collapse rows with duplicated name column
#'
#' @param dat a \cite{tibble} with the columns name, gene and value
#' @importFrom plyr ddply
#' @import tibble
#' @return a \cite{tibble}
#' @export
#'
#' @examples
#' dat <- tibble(name = c(paste0("position", 1:5), paste0("position",
c(1:3))), gene = paste0("gene", 1:8), value = 1:8)
#' summarizeDataFrame(dat)
summarizeDataFrame <- function(dat){
ddply(dat, "name", "summarize",
name=unique(name),
gene=paste(unique(gene), collapse = ","),
value=mean(value))
}
R interprets the "name", "gene" and "value" column names as variables
during the check. Does anyone has an idea how to change the syntax of
ddply or how to get rid of the warning message?
Thanks in advance!
Tobias
More information about the Bioc-devel
mailing list