summary_sam: Method to summarize 'SAM' or 'Smooth' objects.

Description Usage Arguments Value Examples

View source: R/summary_methods.R

Description

Summary method for SAM and Smooth objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S4 method for signature 'summary_sam'
summary(object, ...)

summary_sam(
  object,
  mask = NULL,
  clusternames = NULL,
  slice = 1,
  window = NULL,
  smooth = TRUE,
  temporal = FALSE
)

Arguments

object

An object of class SAM or Smooth. It accepts also object of S3 class "clipper" returned by the clipper function.

...

other parameters for summary_sam

mask

a clipper mask returned by toClip function. It should be set to NULL To avoid clipping, the default.

clusternames

The name of the clusters, it should match the clusternames list comprised in the SpectralReference object passed to tile_sam or mosaic_sam. Mandatory if object is of class SAM when smooth = TRUE.

slice

Which slice of object should be summarized?

window

When smooth = TRUE the size of the window for smooth_sam.

smooth

When object if of class SAM, should the function silently apply smooth_sam before summarizing?.

temporal

if TRUE the raster and shape files from which the summary is extracted are written in the working directory.

Value

A dataframe with three columns showing the cluster number, the area in pixels^2, and the cluster name as character (only if the parameeter clusternames is within the function call). Each row stand for a single particle. The function writes on disk two files "raster_out.tif" which is a raster of the object passed through the object paramenter, and a shape_out "ESRI Shapefile" folder with a shapefile holding a vectorized version of "raster_out.tif".

Examples

1
2
3
4
x <- mosaic_info(base::system.file("extdata/mosaic.dmt", package = "uFTIR"))
mosaic_sam(x, primpke, n_cores = 1)
y <- mosaic_compose(x@path, clusterlist = primpke@clusterlist)
summary_sam(y, clusternames = primpke@clusternames, smooth = FALSE, temporal = TRUE)

uFTIR documentation built on Oct. 25, 2021, 9:08 a.m.