patchify_SAR_matrix: patchify_SAR_matrix

Description Usage Arguments Value Examples

View source: R/load_and_reshape.R

Description

Reduce the resolution of images (columns) in a SAR_matrix object m, by aggregating all values inside d \times d patches using the aggregation function fun.

Usage

1

Arguments

m

An SAR_matrix object, such as that output by load_SAR_matrix.

d

The dimension of patches.

fun

The aggregation function. Default is mean.

Value

A SAR_matrix of reduced dimension, with appropriately adjusted raster attributes.

Examples

1
2
3
4
5
6
7
8
9
filename <- system.file(
  "extdata", "MG_CC_sub_norm_testclip.tif", package="rsar")
m <- load_SAR_matrix(filename)
dim(m)
mp <- patchify_SAR_matrix(m,4)
head(mp)
dim(mp)
bp <- matrix_to_brick(mp)
raster::plot(bp)

frycast/rsar documentation built on Sept. 4, 2020, 3:52 a.m.