Skip to content

Commit

Permalink
fff
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Jul 15, 2024
1 parent 6e79a22 commit 0f35cfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/princomp.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ setMethod("princomp", signature(x="SpatRaster"),

setMethod("prcomp", signature(x="SpatRaster"),
function(x, retx = TRUE, center = TRUE, scale. = FALSE, tol = NULL, rank. = NULL, maxcell=Inf) {
x <- na.omit(spatSample(x, maxcell, "regular"))
p <- prcomp(x, retx=retx, center=center, scale.=scale., tol=tol, rank.=rank.)
d <- na.omit(spatSample(x, maxcell, "regular"))
p <- prcomp(d, retx=retx, center=center, scale.=scale., tol=tol, rank.=rank.)
nms <- names(p$center)
nms <- nms[!(nms %in% names(x))]
if (length(nms) > 0) {
warn("prcomp", "layer names were changed to make them valid. See 'valid.names'")
warn("prcomp", "names were changed to make them valid. See 'valid.names'")
}
p
}
Expand Down

0 comments on commit 0f35cfe

Please sign in to comment.