Learn R Programming

uFTIR (version 0.1.4)

plot,plot.uFTIR,missing-method: Plotting Objects

Description

Plotting method for objects of class Tile, SpectralPack, SAM, Smooth, and clipper.

In objects of class SAM, always the clusters slot gets plotted.

Usage

# S4 method for plot.uFTIR,missing
plot(x, y, ...)

plot_tile(x, slice = 1, FUN = sum, match_uFTIR = FALSE, ...)

Arguments

x

Tile, SpectralPack, SAM, Smooth, or clipper to plot.

y

Missing.

...

Further arguments to plot

slice

For objects of class SAM or Smooth, Which slice of the cube should be plotted?

FUN

For objects of class SpectralPack and Tile, Which function should be used to collapse the cube to a matrix?

match_uFTIR

The Agilent Microscope transposes and inverts the image (it inverts rows only -cols after transposition). Do you want the plot function to match this behaviour? Default FALSE.

Value

A function that plots a tile and returns NULL.

Details

The function requires the raster package to plot. It coerses the matrix to raster to do so.

Examples

Run this code
# NOT RUN {
# Tile objects:
x <- tile_read(base::system.file("extdata/tile.bsp", package = "uFTIR"))
plot(x)
# with arguments for raster::plot
plot(x, axes = FALSE, box = FALSE, legend = FALSE)

# SpectralPack objects:
x <- tile_base_corr(x)
x <- wavealign(x, primpke)
plot(x) 

# SAM objects:
x <- tile_sam(x)
plot(x)

# Smooth objects
x <- smooth_sam(x, as.integer(length(primpke@clusternames)), window = 3, 1)
plot(x)

# clipper objects:
clip <- toClip(8,20,c(10,10))
polygon(clip@xycoords)
x <- clipper(x, clip@centre, clip@rad, 1)
plot(x)
# }

Run the code above in your browser using DataLab