Skip to content

Commit

Permalink
CVA <-> PCA
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstiDE committed Jan 15, 2024
1 parent bf4e86c commit 15a225c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions R/rasterCVA.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
#' Returns a SpatRaster with two layers: change vector angle and change vector magnitude
#' @export
#' @examples
#' \dontrun{
#' library(terra)
#' pca <- rasterPCA(lsat)$map
#'
#' ## Do change vector analysis
#' 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)
Expand Down
2 changes: 2 additions & 0 deletions R/rasterPCA.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down
2 changes: 0 additions & 2 deletions man/rasterCVA.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/rasterPCA.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 15a225c

Please sign in to comment.