filter_Stk: Wrapper for 'filter_Rst' to filter RasterStacks

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/filter_Stk.R

Description

applies several filter functions to each RasterLayer in a RasterStack.

Usage

1
filter_Stk(stk, fLS = "all", sizes, layernames = names(stk))

Arguments

fLS

comma-separated character combinations of the desired filter functions. Select from "sum","min","max","sd","mean","modal","sobel","sobel_hrzt","sobel_vert". default = all; (see details).

sizes

numeric - a single value or combinations for the MovingWindow, number must be odd.

layernames

optional - comma-seperated character combinations of the desired layernames.

Stk

a RasterStack.

Details

available filter functions

Value

returns a RasterStack with the desired filtered artificial layers.

Author(s)

Andreas Schönberg

See Also

focal,filter_Rst

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
### load data
extpath <-system.file("extdata","lau_mspec.tif",package = "LEGION")
mspec <- raster::stack(extpath)
### compute all filters or every layer in stack
x <- filter_Stk(mspec,sizes=3)
x # note that the names are basic set x.1
### define layernames
ln <- c("blue","green","red","nir")
z <- filter_Stk(mspec,fLS="sum",sizes=3,layernames=ln)
names(z)
### compute specific filters
flist <- c("modal","sobel_vert","mean")
y <- filter_Stk(mspec,fLS=flist,sizes=c(3,5,7))
y

SchoenbergA/LEGION documentation built on Jan. 31, 2021, 10:12 a.m.