CRAN Package Check Results for Package ber

Last updated on 2020-02-19 10:48:47 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 4.0 2.63 22.90 25.53 ERROR
r-devel-linux-x86_64-debian-gcc 4.0 1.99 17.89 19.88 ERROR
r-devel-linux-x86_64-fedora-clang 4.0 32.57 ERROR
r-devel-linux-x86_64-fedora-gcc 4.0 31.97 ERROR
r-devel-windows-ix86+x86_64 4.0 6.00 33.00 39.00 NOTE
r-devel-windows-ix86+x86_64-gcc8 4.0 11.00 46.00 57.00 NOTE
r-patched-linux-x86_64 4.0 2.43 20.54 22.97 NOTE
r-patched-solaris-x86 4.0 45.50 NOTE
r-release-linux-x86_64 4.0 1.98 20.80 22.78 NOTE
r-release-windows-ix86+x86_64 4.0 5.00 33.00 38.00 NOTE
r-release-osx-x86_64 4.0 NOTE
r-oldrel-windows-ix86+x86_64 4.0 4.00 33.00 37.00 NOTE
r-oldrel-osx-x86_64 4.0 NOTE

Check Details

Version: 4.0
Check: dependencies in R code
Result: NOTE
    'library' or 'require' call to 'MASS' which was already attached by Depends.
     Please remove these calls from your code.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 4.0
Check: R code for possible problems
Result: NOTE
    ber: no visible global function definition for 'model.matrix'
    ber: no visible global function definition for 'as.formula'
    ber_bg: no visible global function definition for 'model.matrix'
    ber_bg: no visible global function definition for 'as.formula'
    combat_np: no visible global function definition for 'as.formula'
    combat_np: no visible global function definition for 'model.matrix'
    combat_p: no visible global function definition for 'as.formula'
    combat_p: no visible global function definition for 'model.matrix'
    combat_p: no visible binding for global variable 'var'
    combat_p: no visible global function definition for 'par'
    combat_p: no visible global function definition for 'density'
    combat_p: no visible global function definition for 'plot'
    combat_p: no visible global function definition for 'lines'
    combat_p: no visible global function definition for 'dnorm'
    combat_p: no visible global function definition for 'qqnorm'
    combat_p: no visible global function definition for 'qqline'
    combat_p: no visible global function definition for 'rgamma'
    combat_p: no visible global function definition for 'qqplot'
    combat_p: no visible global function definition for 'title'
    mean_centering: no visible global function definition for
     'model.matrix'
    standardization: no visible global function definition for
     'model.matrix'
    Undefined global functions or variables:
     as.formula density dnorm lines model.matrix par plot qqline qqnorm
     qqplot rgamma title var
    Consider adding
     importFrom("graphics", "lines", "par", "plot", "title")
     importFrom("stats", "as.formula", "density", "dnorm", "model.matrix",
     "qqline", "qqnorm", "qqplot", "rgamma", "var")
    to your NAMESPACE file.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 4.0
Check: examples
Result: ERROR
    Running examples in 'ber-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: ber
    > ### Title: Batch Effects Removal
    > ### Aliases: ber
    >
    > ### ** Examples
    >
    > Y<-matrix(rnorm(6000),nrow=12)
    > class<-gl(2,6,labels=c("Control","Treat"))
    > class<-data.frame(class)
    > batch<-rep(gl(2,3,labels=c("Batch1","Batch2")),2)
    > YEadj<-ber(Y,batch,class)
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    ber
     --- call from context ---
    ber(Y, batch, class)
     --- call from argument ---
    if (class(Y) != "matrix") {
     stop("'Y' must be of class 'matrix'\n")
    }
     --- R stacktrace ---
    where 1: ber(Y, batch, class)
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (Y, b, covariates = NULL)
    {
     if (missing(Y)) {
     stop("Argument 'Y' missing, with no default\n")
     }
     if (missing(b)) {
     stop("Argument 'b' missing, with no default\n")
     }
     if (class(Y) != "matrix") {
     stop("'Y' must be of class 'matrix'\n")
     }
     if (class(b) != "factor") {
     stop("'b' must be of class 'factor'\n")
     }
     if (any(is.na(Y))) {
     stop("NA values are not allowed in 'Y'\n")
     }
     if (any(is.na(b))) {
     stop("NA values are not allowed in 'b'\n")
     }
     if (length(b) != nrow(Y)) {
     stop("length(b) is different from nrow(Y)\n")
     }
     if (any(apply(Y, 2, mode) != "numeric")) {
     stop("Array expression columns contain non-numeric values!\n")
     }
     if (!is.null(covariates)) {
     if (class(covariates) != "data.frame") {
     stop("'covariates' must be of class 'data.frame'\n")
     }
     col.cov <- ncol(covariates)
     for (i in 1:col.cov) {
     if (class(covariates[, i]) != "numeric" & class(covariates[,
     i]) != "factor") {
     stop("column ", i, " of 'covariates' must be of class 'factor' or 'numeric'\n")
     }
     }
     if (any(is.na(covariates))) {
     stop("NA values are not allowed in 'covariates'\n")
     }
     }
     cnames <- colnames(Y)
     rnames <- rownames(Y)
     if (is.null(covariates)) {
     library(MASS)
     n <- dim(Y)[1]
     g <- dim(Y)[2]
     m <- nlevels(b)
     X <- model.matrix(~b - 1)
     Xinv <- ginv(X)
     B <- Xinv %*% Y
     XB_hat <- X %*% B
     adjY <- Y - XB_hat
     res_squared <- adjY^2
     genes_mean <- apply(XB_hat, 2, mean)
     genes_mean_matrix <- matrix(rep(genes_mean, n), byrow = TRUE,
     nrow = n)
     Bdouble <- Xinv %*% res_squared
     XD_hat <- X %*% Bdouble
     genes_var <- apply(XD_hat, 2, mean)
     genes_var_matrix <- matrix(rep(genes_var, n), byrow = TRUE,
     nrow = n)
     ScaleFactors <- sqrt(genes_var_matrix/(XD_hat))
     adjYdouble <- ScaleFactors * adjY
     adjYdouble <- ScaleFactors * adjY + genes_mean_matrix
     colnames(adjYdouble) <- cnames
     rownames(adjYdouble) <- rnames
     return(adjYdouble)
     }
     else {
     library(MASS)
     n <- dim(Y)[1]
     g <- dim(Y)[2]
     m1 <- nlevels(b)
     X1 <- model.matrix(~b - 1)
     colnames(covariates) <- paste("col", 1:ncol(covariates),
     sep = "")
     fmla <- as.formula(paste("~", paste(colnames(covariates),
     collapse = "+")))
     X2 <- model.matrix(fmla, covariates)
     X2 <- as.matrix(X2[, -1])
     m2 <- dim(X2)[2]
     X <- cbind(X1, X2)
     Xinv <- ginv(X)
     B <- Xinv %*% Y
     B1 <- B[1:m1, ]
     B2 <- B[(m1 + 1):(m1 + m2), ]
     XB_hat <- X %*% B
     adjY <- Y - XB_hat
     res_squared <- adjY^2
     genes_mean <- apply(X1 %*% B1, 2, mean)
     genes_mean_matrix <- matrix(rep(genes_mean, n), byrow = TRUE,
     nrow = n)
     X1inv <- ginv(X1)
     Bdouble1 <- X1inv %*% res_squared
     X1D1_hat <- X1 %*% Bdouble1
     genes_var <- apply(X1D1_hat, 2, mean)
     genes_var_matrix <- matrix(rep(genes_var, n), byrow = TRUE,
     nrow = n)
     ScaleFactors <- sqrt(genes_var_matrix/(X1D1_hat))
     adjYdouble <- ScaleFactors * adjY
     adjYdouble <- adjYdouble + genes_mean_matrix + X2 %*%
     B2
     colnames(adjYdouble) <- cnames
     rownames(adjYdouble) <- rnames
     return(adjYdouble)
     }
    }
    <bytecode: 0x312ef70>
    <environment: namespace:ber>
     --- function search by body ---
    Function ber in namespace ber has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(Y) != "matrix") { : the condition has length > 1
    Calls: ber
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 4.0
Check: examples
Result: ERROR
    Running examples in ‘ber-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: ber
    > ### Title: Batch Effects Removal
    > ### Aliases: ber
    >
    > ### ** Examples
    >
    > Y<-matrix(rnorm(6000),nrow=12)
    > class<-gl(2,6,labels=c("Control","Treat"))
    > class<-data.frame(class)
    > batch<-rep(gl(2,3,labels=c("Batch1","Batch2")),2)
    > YEadj<-ber(Y,batch,class)
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    ber
     --- call from context ---
    ber(Y, batch, class)
     --- call from argument ---
    if (class(Y) != "matrix") {
     stop("'Y' must be of class 'matrix'\n")
    }
     --- R stacktrace ---
    where 1: ber(Y, batch, class)
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (Y, b, covariates = NULL)
    {
     if (missing(Y)) {
     stop("Argument 'Y' missing, with no default\n")
     }
     if (missing(b)) {
     stop("Argument 'b' missing, with no default\n")
     }
     if (class(Y) != "matrix") {
     stop("'Y' must be of class 'matrix'\n")
     }
     if (class(b) != "factor") {
     stop("'b' must be of class 'factor'\n")
     }
     if (any(is.na(Y))) {
     stop("NA values are not allowed in 'Y'\n")
     }
     if (any(is.na(b))) {
     stop("NA values are not allowed in 'b'\n")
     }
     if (length(b) != nrow(Y)) {
     stop("length(b) is different from nrow(Y)\n")
     }
     if (any(apply(Y, 2, mode) != "numeric")) {
     stop("Array expression columns contain non-numeric values!\n")
     }
     if (!is.null(covariates)) {
     if (class(covariates) != "data.frame") {
     stop("'covariates' must be of class 'data.frame'\n")
     }
     col.cov <- ncol(covariates)
     for (i in 1:col.cov) {
     if (class(covariates[, i]) != "numeric" & class(covariates[,
     i]) != "factor") {
     stop("column ", i, " of 'covariates' must be of class 'factor' or 'numeric'\n")
     }
     }
     if (any(is.na(covariates))) {
     stop("NA values are not allowed in 'covariates'\n")
     }
     }
     cnames <- colnames(Y)
     rnames <- rownames(Y)
     if (is.null(covariates)) {
     library(MASS)
     n <- dim(Y)[1]
     g <- dim(Y)[2]
     m <- nlevels(b)
     X <- model.matrix(~b - 1)
     Xinv <- ginv(X)
     B <- Xinv %*% Y
     XB_hat <- X %*% B
     adjY <- Y - XB_hat
     res_squared <- adjY^2
     genes_mean <- apply(XB_hat, 2, mean)
     genes_mean_matrix <- matrix(rep(genes_mean, n), byrow = TRUE,
     nrow = n)
     Bdouble <- Xinv %*% res_squared
     XD_hat <- X %*% Bdouble
     genes_var <- apply(XD_hat, 2, mean)
     genes_var_matrix <- matrix(rep(genes_var, n), byrow = TRUE,
     nrow = n)
     ScaleFactors <- sqrt(genes_var_matrix/(XD_hat))
     adjYdouble <- ScaleFactors * adjY
     adjYdouble <- ScaleFactors * adjY + genes_mean_matrix
     colnames(adjYdouble) <- cnames
     rownames(adjYdouble) <- rnames
     return(adjYdouble)
     }
     else {
     library(MASS)
     n <- dim(Y)[1]
     g <- dim(Y)[2]
     m1 <- nlevels(b)
     X1 <- model.matrix(~b - 1)
     colnames(covariates) <- paste("col", 1:ncol(covariates),
     sep = "")
     fmla <- as.formula(paste("~", paste(colnames(covariates),
     collapse = "+")))
     X2 <- model.matrix(fmla, covariates)
     X2 <- as.matrix(X2[, -1])
     m2 <- dim(X2)[2]
     X <- cbind(X1, X2)
     Xinv <- ginv(X)
     B <- Xinv %*% Y
     B1 <- B[1:m1, ]
     B2 <- B[(m1 + 1):(m1 + m2), ]
     XB_hat <- X %*% B
     adjY <- Y - XB_hat
     res_squared <- adjY^2
     genes_mean <- apply(X1 %*% B1, 2, mean)
     genes_mean_matrix <- matrix(rep(genes_mean, n), byrow = TRUE,
     nrow = n)
     X1inv <- ginv(X1)
     Bdouble1 <- X1inv %*% res_squared
     X1D1_hat <- X1 %*% Bdouble1
     genes_var <- apply(X1D1_hat, 2, mean)
     genes_var_matrix <- matrix(rep(genes_var, n), byrow = TRUE,
     nrow = n)
     ScaleFactors <- sqrt(genes_var_matrix/(X1D1_hat))
     adjYdouble <- ScaleFactors * adjY
     adjYdouble <- adjYdouble + genes_mean_matrix + X2 %*%
     B2
     colnames(adjYdouble) <- cnames
     rownames(adjYdouble) <- rnames
     return(adjYdouble)
     }
    }
    <bytecode: 0x557b861d1560>
    <environment: namespace:ber>
     --- function search by body ---
    Function ber in namespace ber has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(Y) != "matrix") { : the condition has length > 1
    Calls: ber
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 4.0
Check: examples
Result: ERROR
    Running examples in ‘ber-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: ber
    > ### Title: Batch Effects Removal
    > ### Aliases: ber
    >
    > ### ** Examples
    >
    > Y<-matrix(rnorm(6000),nrow=12)
    > class<-gl(2,6,labels=c("Control","Treat"))
    > class<-data.frame(class)
    > batch<-rep(gl(2,3,labels=c("Batch1","Batch2")),2)
    > YEadj<-ber(Y,batch,class)
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    ber
     --- call from context ---
    ber(Y, batch, class)
     --- call from argument ---
    if (class(Y) != "matrix") {
     stop("'Y' must be of class 'matrix'\n")
    }
     --- R stacktrace ---
    where 1: ber(Y, batch, class)
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (Y, b, covariates = NULL)
    {
     if (missing(Y)) {
     stop("Argument 'Y' missing, with no default\n")
     }
     if (missing(b)) {
     stop("Argument 'b' missing, with no default\n")
     }
     if (class(Y) != "matrix") {
     stop("'Y' must be of class 'matrix'\n")
     }
     if (class(b) != "factor") {
     stop("'b' must be of class 'factor'\n")
     }
     if (any(is.na(Y))) {
     stop("NA values are not allowed in 'Y'\n")
     }
     if (any(is.na(b))) {
     stop("NA values are not allowed in 'b'\n")
     }
     if (length(b) != nrow(Y)) {
     stop("length(b) is different from nrow(Y)\n")
     }
     if (any(apply(Y, 2, mode) != "numeric")) {
     stop("Array expression columns contain non-numeric values!\n")
     }
     if (!is.null(covariates)) {
     if (class(covariates) != "data.frame") {
     stop("'covariates' must be of class 'data.frame'\n")
     }
     col.cov <- ncol(covariates)
     for (i in 1:col.cov) {
     if (class(covariates[, i]) != "numeric" & class(covariates[,
     i]) != "factor") {
     stop("column ", i, " of 'covariates' must be of class 'factor' or 'numeric'\n")
     }
     }
     if (any(is.na(covariates))) {
     stop("NA values are not allowed in 'covariates'\n")
     }
     }
     cnames <- colnames(Y)
     rnames <- rownames(Y)
     if (is.null(covariates)) {
     library(MASS)
     n <- dim(Y)[1]
     g <- dim(Y)[2]
     m <- nlevels(b)
     X <- model.matrix(~b - 1)
     Xinv <- ginv(X)
     B <- Xinv %*% Y
     XB_hat <- X %*% B
     adjY <- Y - XB_hat
     res_squared <- adjY^2
     genes_mean <- apply(XB_hat, 2, mean)
     genes_mean_matrix <- matrix(rep(genes_mean, n), byrow = TRUE,
     nrow = n)
     Bdouble <- Xinv %*% res_squared
     XD_hat <- X %*% Bdouble
     genes_var <- apply(XD_hat, 2, mean)
     genes_var_matrix <- matrix(rep(genes_var, n), byrow = TRUE,
     nrow = n)
     ScaleFactors <- sqrt(genes_var_matrix/(XD_hat))
     adjYdouble <- ScaleFactors * adjY
     adjYdouble <- ScaleFactors * adjY + genes_mean_matrix
     colnames(adjYdouble) <- cnames
     rownames(adjYdouble) <- rnames
     return(adjYdouble)
     }
     else {
     library(MASS)
     n <- dim(Y)[1]
     g <- dim(Y)[2]
     m1 <- nlevels(b)
     X1 <- model.matrix(~b - 1)
     colnames(covariates) <- paste("col", 1:ncol(covariates),
     sep = "")
     fmla <- as.formula(paste("~", paste(colnames(covariates),
     collapse = "+")))
     X2 <- model.matrix(fmla, covariates)
     X2 <- as.matrix(X2[, -1])
     m2 <- dim(X2)[2]
     X <- cbind(X1, X2)
     Xinv <- ginv(X)
     B <- Xinv %*% Y
     B1 <- B[1:m1, ]
     B2 <- B[(m1 + 1):(m1 + m2), ]
     XB_hat <- X %*% B
     adjY <- Y - XB_hat
     res_squared <- adjY^2
     genes_mean <- apply(X1 %*% B1, 2, mean)
     genes_mean_matrix <- matrix(rep(genes_mean, n), byrow = TRUE,
     nrow = n)
     X1inv <- ginv(X1)
     Bdouble1 <- X1inv %*% res_squared
     X1D1_hat <- X1 %*% Bdouble1
     genes_var <- apply(X1D1_hat, 2, mean)
     genes_var_matrix <- matrix(rep(genes_var, n), byrow = TRUE,
     nrow = n)
     ScaleFactors <- sqrt(genes_var_matrix/(X1D1_hat))
     adjYdouble <- ScaleFactors * adjY
     adjYdouble <- adjYdouble + genes_mean_matrix + X2 %*%
     B2
     colnames(adjYdouble) <- cnames
     rownames(adjYdouble) <- rnames
     return(adjYdouble)
     }
    }
    <bytecode: 0x29321e0>
    <environment: namespace:ber>
     --- function search by body ---
    Function ber in namespace ber has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(Y) != "matrix") { : the condition has length > 1
    Calls: ber
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 4.0
Check: examples
Result: ERROR
    Running examples in ‘ber-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: ber
    > ### Title: Batch Effects Removal
    > ### Aliases: ber
    >
    > ### ** Examples
    >
    > Y<-matrix(rnorm(6000),nrow=12)
    > class<-gl(2,6,labels=c("Control","Treat"))
    > class<-data.frame(class)
    > batch<-rep(gl(2,3,labels=c("Batch1","Batch2")),2)
    > YEadj<-ber(Y,batch,class)
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    ber
     --- call from context ---
    ber(Y, batch, class)
     --- call from argument ---
    if (class(Y) != "matrix") {
     stop("'Y' must be of class 'matrix'\n")
    }
     --- R stacktrace ---
    where 1: ber(Y, batch, class)
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (Y, b, covariates = NULL)
    {
     if (missing(Y)) {
     stop("Argument 'Y' missing, with no default\n")
     }
     if (missing(b)) {
     stop("Argument 'b' missing, with no default\n")
     }
     if (class(Y) != "matrix") {
     stop("'Y' must be of class 'matrix'\n")
     }
     if (class(b) != "factor") {
     stop("'b' must be of class 'factor'\n")
     }
     if (any(is.na(Y))) {
     stop("NA values are not allowed in 'Y'\n")
     }
     if (any(is.na(b))) {
     stop("NA values are not allowed in 'b'\n")
     }
     if (length(b) != nrow(Y)) {
     stop("length(b) is different from nrow(Y)\n")
     }
     if (any(apply(Y, 2, mode) != "numeric")) {
     stop("Array expression columns contain non-numeric values!\n")
     }
     if (!is.null(covariates)) {
     if (class(covariates) != "data.frame") {
     stop("'covariates' must be of class 'data.frame'\n")
     }
     col.cov <- ncol(covariates)
     for (i in 1:col.cov) {
     if (class(covariates[, i]) != "numeric" & class(covariates[,
     i]) != "factor") {
     stop("column ", i, " of 'covariates' must be of class 'factor' or 'numeric'\n")
     }
     }
     if (any(is.na(covariates))) {
     stop("NA values are not allowed in 'covariates'\n")
     }
     }
     cnames <- colnames(Y)
     rnames <- rownames(Y)
     if (is.null(covariates)) {
     library(MASS)
     n <- dim(Y)[1]
     g <- dim(Y)[2]
     m <- nlevels(b)
     X <- model.matrix(~b - 1)
     Xinv <- ginv(X)
     B <- Xinv %*% Y
     XB_hat <- X %*% B
     adjY <- Y - XB_hat
     res_squared <- adjY^2
     genes_mean <- apply(XB_hat, 2, mean)
     genes_mean_matrix <- matrix(rep(genes_mean, n), byrow = TRUE,
     nrow = n)
     Bdouble <- Xinv %*% res_squared
     XD_hat <- X %*% Bdouble
     genes_var <- apply(XD_hat, 2, mean)
     genes_var_matrix <- matrix(rep(genes_var, n), byrow = TRUE,
     nrow = n)
     ScaleFactors <- sqrt(genes_var_matrix/(XD_hat))
     adjYdouble <- ScaleFactors * adjY
     adjYdouble <- ScaleFactors * adjY + genes_mean_matrix
     colnames(adjYdouble) <- cnames
     rownames(adjYdouble) <- rnames
     return(adjYdouble)
     }
     else {
     library(MASS)
     n <- dim(Y)[1]
     g <- dim(Y)[2]
     m1 <- nlevels(b)
     X1 <- model.matrix(~b - 1)
     colnames(covariates) <- paste("col", 1:ncol(covariates),
     sep = "")
     fmla <- as.formula(paste("~", paste(colnames(covariates),
     collapse = "+")))
     X2 <- model.matrix(fmla, covariates)
     X2 <- as.matrix(X2[, -1])
     m2 <- dim(X2)[2]
     X <- cbind(X1, X2)
     Xinv <- ginv(X)
     B <- Xinv %*% Y
     B1 <- B[1:m1, ]
     B2 <- B[(m1 + 1):(m1 + m2), ]
     XB_hat <- X %*% B
     adjY <- Y - XB_hat
     res_squared <- adjY^2
     genes_mean <- apply(X1 %*% B1, 2, mean)
     genes_mean_matrix <- matrix(rep(genes_mean, n), byrow = TRUE,
     nrow = n)
     X1inv <- ginv(X1)
     Bdouble1 <- X1inv %*% res_squared
     X1D1_hat <- X1 %*% Bdouble1
     genes_var <- apply(X1D1_hat, 2, mean)
     genes_var_matrix <- matrix(rep(genes_var, n), byrow = TRUE,
     nrow = n)
     ScaleFactors <- sqrt(genes_var_matrix/(X1D1_hat))
     adjYdouble <- ScaleFactors * adjY
     adjYdouble <- adjYdouble + genes_mean_matrix + X2 %*%
     B2
     colnames(adjYdouble) <- cnames
     rownames(adjYdouble) <- rnames
     return(adjYdouble)
     }
    }
    <bytecode: 0x31a1988>
    <environment: namespace:ber>
     --- function search by body ---
    Function ber in namespace ber has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(Y) != "matrix") { : the condition has length > 1
    Calls: ber
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc