diff --git a/R/rasterCVA.R b/R/rasterCVA.R index 9b38787..2a5d992 100644 --- a/R/rasterCVA.R +++ b/R/rasterCVA.R @@ -21,7 +21,6 @@ #' Returns a SpatRaster with two layers: change vector angle and change vector magnitude #' @export #' @examples -#' \dontrun{ #' library(terra) #' pca <- rasterPCA(lsat)$map #' @@ -29,7 +28,6 @@ #' cva <- rasterCVA(pca[[1:2]], pca[[3:4]]) #' cva #' plot(cva) -#' } rasterCVA <- function(x, y, tmf = NULL, nct = NULL, ...) { x <- .toTerra(x) y <- .toTerra(y) diff --git a/R/rasterPCA.R b/R/rasterPCA.R index 0ddbe1d..fc03ee1 100644 --- a/R/rasterPCA.R +++ b/R/rasterPCA.R @@ -24,6 +24,7 @@ #' @return Returns a named list containing the PCA model object ($model) and a SpatRaster with the principal component layers ($object). #' @export #' @examples +#' \dontrun{ #' library(ggplot2) #' library(reshape2) #' ggRGB(rlogo, 1,2,3) @@ -42,6 +43,7 @@ #' plots <- lapply(1:3, function(x) ggR(rpc$map, x, geom_raster = TRUE)) #' grid.arrange(plots[[1]],plots[[2]], plots[[3]], ncol=2) #' } +#' } rasterPCA <- function(img, nSamples = NULL, nComp = nlyr(img), spca = FALSE, maskCheck = TRUE, ...){ img <- .toTerra(img) diff --git a/man/rasterCVA.Rd b/man/rasterCVA.Rd index e3dbdb3..5e895cf 100644 --- a/man/rasterCVA.Rd +++ b/man/rasterCVA.Rd @@ -33,7 +33,6 @@ For example for a given pixel in image A and B for the red and nir band the chan Angles are returned *in degree* beginning with 0 degrees pointing 'north', i.e. the y-axis, i.e. the second band. } \examples{ -\dontrun{ library(terra) pca <- rasterPCA(lsat)$map @@ -42,4 +41,3 @@ cva <- rasterCVA(pca[[1:2]], pca[[3:4]]) cva plot(cva) } -} diff --git a/man/rasterPCA.Rd b/man/rasterPCA.Rd index 6e94307..051c0e4 100644 --- a/man/rasterPCA.Rd +++ b/man/rasterPCA.Rd @@ -47,6 +47,7 @@ Standardised PCA (SPCA) can be useful if imagery or bands of different dynamic r has the same effect as using normalised bands of unit variance. } \examples{ +\dontrun{ library(ggplot2) library(reshape2) ggRGB(rlogo, 1,2,3) @@ -66,3 +67,4 @@ if(require(gridExtra)){ grid.arrange(plots[[1]],plots[[2]], plots[[3]], ncol=2) } } +}