Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Manon Martin authored and Manon Martin committed Jun 6, 2023
1 parent 7923d3a commit b644556
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/plotMeans.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ plotMeans <- function(Y, design, cols = NULL, x, z = NULL, w = NULL,
}
}

if (max(cols) > ncol(Y)){
stop(paste0("Columns (",paste0(cols, collapse = ",")
,") is beyond the number of columns of Y (",ncol(Y),")"))
}

if(!x %in% colnames(design)){
stop(paste0(x," is not a factor of the design"))
Expand Down Expand Up @@ -123,6 +119,11 @@ plotMeans <- function(Y, design, cols = NULL, x, z = NULL, w = NULL,
cols <- grep(cols, colnames(Y))
}

if (max(cols) > ncol(Y)){
stop(paste0("Columns (",paste0(cols, collapse = ",")
,") is beyond the number of columns of Y (",ncol(Y),")"))
}

dataplot <- stats::aggregate(Y[,cols], by = design[c(x,z,w)], mean)
names(dataplot) <- c(x, z, w, colnames(Y)[cols])

Expand Down

0 comments on commit b644556

Please sign in to comment.