Learn R Programming

patternize (version 0.0.5)

createTarget: Create a target image (RasterStack) from a polygon.

Description

Create a target image (RasterStack) from a polygon.

Usage

createTarget(
  outline,
  image,
  res = 300,
  colorFill = "black",
  colorBG = "white",
  sigma = 10,
  plot = FALSE
)

Value

RasterStack

Arguments

outline

xy coordinates that define outline.

image

Image imported as RasterStack used in the analysis. This is used to extract the extent and dimensions for the raster layers.

res

Resolution for RasterStack (default = 300).

colorFill

Color for the fill of the polygon (default = 'black').

colorBG

Color for the background (default = 'white').

sigma

Size of sigma for Gaussian blurring (default = 10).

plot

Whether to plot the created target image (default = FALSE).

Examples

Run this code

if (FALSE) {
outline_BC0077 <- read.table(paste(system.file("extdata",  package = 'patternize'),
'/BC0077_outline.txt', sep=''), header = FALSE)

data(imageList)

target <- createTarget(outline_BC0077, imageList[[1]], plot =  TRUE)
}

Run the code above in your browser using DataLab