diff --git a/man/prcomp.Rd b/man/prcomp.Rd index a921e94ec..7a2b430d5 100644 --- a/man/prcomp.Rd +++ b/man/prcomp.Rd @@ -6,7 +6,7 @@ \title{SpatRaster PCA with prcomp} \description{ -Compute principal components for SpatRaster layers. For very large rasters this can only be done with a sample. This may be good enough but see \code{\link{prcomp}} if you want to use all values. +Compute principal components for SpatRaster layers. This method is may be preferred due to greater numerical accuracy, however it is slower and for very large rasters it can only be done with a sample. This may be good enough but see \code{\link{princomp}} if you want to use all values. Unlike \code{\link{princomp}}, in this method the sample variances are used with \code{n-1} as the denominator. } \usage{ @@ -28,7 +28,7 @@ Compute principal components for SpatRaster layers. For very large rasters this prcomp object } -\author{Alex Ilich and Robert Hijmans, based on a similar method by Benjamin Leutner} +\author{Robert Hijmans} \seealso{ \code{\link{princomp}}, \code{\link[stats]{prcomp}}} diff --git a/man/princomp.Rd b/man/princomp.Rd index 203fe41d5..6476b21d1 100644 --- a/man/princomp.Rd +++ b/man/princomp.Rd @@ -8,7 +8,8 @@ \description{ Compute principal components for SpatRaster layers. The benefit of this method is that it uses all values to compute the principal components, even for very large rasters. This is because it computes the covariance matrix by processing the data in chunks, if necessary, using \code{\link{layerCor}}. The population covariance is used (not the sample, with \code{n-1} denominator, covariance). -Alternatively, you can use \code{stats::\link[stats]{princomp}} or \code{stats::\link[stats]{prcomp}} with a data.frame of the raster values, using a sample for very large rasters (see the examples below). +Alternatively, you can specify \code{maxcell} or sample raster values to a data.frame to speed up calculations for very large rasters (see the examples below). +See \code{\link{princomp}} for an alternative method that has better numerical accuracy, but is slower, and for very large rasters can only be accomplished with a sample since all values must be read into memory. } \usage{ @@ -30,7 +31,7 @@ princomp object \author{Alex Ilich and Robert Hijmans, based on a similar method by Benjamin Leutner} -\seealso{ \code{\link[stats]{princomp}}} +\seealso{ \code{\link{prcomp}} \code{\link[stats]{princomp}}} \examples{ f <- system.file("ex/logo.tif", package = "terra")