Skip to content

Commit

Permalink
update list checking using is.list()
Browse files Browse the repository at this point in the history
  • Loading branch information
maotian06 committed Aug 23, 2024
1 parent ae973a8 commit 656d3fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/apply.scaling.R
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 656d3fc

Please sign in to comment.