From 51ae407526d968f617f6f65d71e22e8b1618e804 Mon Sep 17 00:00:00 2001 From: bleutner Date: Thu, 6 Oct 2016 13:38:26 +0200 Subject: [PATCH] fix docu --- R/pifMatch.R | 14 ++++++++------ man/pifMatch.Rd | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/R/pifMatch.R b/R/pifMatch.R index 45c0a00f..c0d57d27 100755 --- a/R/pifMatch.R +++ b/R/pifMatch.R @@ -30,7 +30,6 @@ #' } #' @export #' @examples -#' library(gridExtra) #' library(raster) #' #' ## Import Landsat example data @@ -41,17 +40,20 @@ #' lsat_b <- log(lsat) #' ## Run pifMatch and return similarity layer, invariant features mask and models #' lsat_b_adj <- pifMatch(lsat_b, lsat, returnPifMap = TRUE, returnSimMap = TRUE, returnModels = TRUE) -#' grid.arrange( -#' ggR(lsat_b_adj$simMap, geom_raster = TRUE) , -#' ggR(lsat_b_adj$pifMap), -#' ncol=2) #' +#' ## Pixelwise similarity +#' ggR(lsat_b_adj$simMap, geom_raster = TRUE) +#' +#' ## Pesudo invariant feature mask +#' ggR(lsat_b_adj$pifMap) +#' +#' ## Histograms of changes #' par(mfrow=c(1,3)) #' hist(lsat_b[[1]], main = "lsat_b") #' hist(lsat[[1]], main = "reference") #' hist(lsat_b_adj$img[[1]], main = "lsat_b adjusted") #' -#' ## Model summary for first band +#' ## Model summary for first band #' summary(lsat_b_adj$models[[1]]) pifMatch <- function(img, ref, method = "cor", quantile = 0.95, returnPifMap = TRUE, returnSimMap = TRUE, returnModels = FALSE){ if(nlayers(img)!=nlayers(ref) | nlayers(img) <= 1) stop("Both images need at least two corresponding bands and must have the same number of bands.", call.=FALSE) diff --git a/man/pifMatch.Rd b/man/pifMatch.Rd index c05c0236..102a2ec4 100644 --- a/man/pifMatch.Rd +++ b/man/pifMatch.Rd @@ -47,7 +47,6 @@ The threshold is defined as a similarity quantile. Setting \code{quantile=0.95} Model fitting is performed with simple linear models (\code{\link[stats]{lm}}); fitting one model per layer. } \examples{ -library(gridExtra) library(raster) ## Import Landsat example data @@ -58,17 +57,20 @@ data(lsat) lsat_b <- log(lsat) ## Run pifMatch and return similarity layer, invariant features mask and models lsat_b_adj <- pifMatch(lsat_b, lsat, returnPifMap = TRUE, returnSimMap = TRUE, returnModels = TRUE) -grid.arrange( -ggR(lsat_b_adj$simMap, geom_raster = TRUE) , -ggR(lsat_b_adj$pifMap), -ncol=2) +## Pixelwise similarity +ggR(lsat_b_adj$simMap, geom_raster = TRUE) + +## Pesudo invariant feature mask +ggR(lsat_b_adj$pifMap) + +## Histograms of changes par(mfrow=c(1,3)) hist(lsat_b[[1]], main = "lsat_b") hist(lsat[[1]], main = "reference") hist(lsat_b_adj$img[[1]], main = "lsat_b adjusted") -## Model summary for first band +## Model summary for first band summary(lsat_b_adj$models[[1]]) }