|
17 | 17 | #' @importFrom stats cor mad median sd setNames |
18 | 18 | #' |
19 | 19 | #' @examples |
20 | | -#' library(magrittr) |
| 20 | +#' suppressMessages(suppressWarnings(library(magrittr))) |
21 | 21 | #' population <- tibble::data_frame( |
22 | 22 | #' Metadata_group = c("control", "control", "control", "control", |
23 | 23 | #' "experiment", "experiment", "experiment", "experiment"), |
|
30 | 30 | #' cytominer::normalize(population, variables, strata, sample, operation = "standardize") |
31 | 31 | #' |
32 | 32 | #' @export |
33 | | -normalize <- function(population, variables, strata, sample, operation = "standardize", ...) { |
| 33 | +normalize <- function(population, variables, strata, sample, |
| 34 | + operation = "standardize", ...) { |
34 | 35 | scale <- function(data, location, dispersion, variables) { |
35 | 36 | if (is.data.frame(data)) { |
36 | 37 | futile.logger::flog.debug(paste0("\t\tUsing base::scale (data is ", |
@@ -59,7 +60,7 @@ normalize <- function(population, variables, strata, sample, operation = "standa |
59 | 60 | s <- dispersion[[variable]] |
60 | 61 |
|
61 | 62 | data %<>% |
62 | | - dplyr::mutate(!!x := ((!!x) - m) / s ) |
| 63 | + dplyr::mutate(!!x := ( (!!x) - m) / s ) |
63 | 64 |
|
64 | 65 | } |
65 | 66 |
|
|
0 commit comments