From 656d3fc0035ceea952024542780126da8b13be03 Mon Sep 17 00:00:00 2001 From: Mao Tian Date: Fri, 23 Aug 2024 16:40:51 -0700 Subject: [PATCH] update list checking using is.list() --- R/apply.scaling.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/apply.scaling.R b/R/apply.scaling.R index d7ddb5c..b2bedf2 100644 --- a/R/apply.scaling.R +++ b/R/apply.scaling.R @@ -18,11 +18,11 @@ apply.scaling <- function(data.matrices, scaling.factors) { } # if necessary adjust the format of the scaling factors for a single matrix - if ('list' == class(scaling.factors$center)) { + if (is.list(scaling.factors$center)) { scaling.factors$center <- scaling.factors$center[[1]]; warning('the first item from the scaling.factor$center list was used for scaling'); } - if ('list' == class(scaling.factors$scale)) { + if (is.list(scaling.factors$scale)) { scaling.factors$scale <- scaling.factors$scale[[1]]; warning('the first item from the scaling.factor$scale list was used for scaling'); }