Learn R Programming

hyperSpec (version 0.95)

plotmap: Plot a Map and Identify Spectra

Description

An image or map of a summary value of each spectrum is plotted. The spectra may be identified by mouse click.

Usage

plotmap (object, x = "x", y = "y", func = mean, cond = NULL, 
         z = NULL, do.print = FALSE, print.args = NULL, trellis.args = NULL,
         ...)
map.identify (object, x = "x", y = "y", ...)

Arguments

object
the hyperSpec object
x, y
names of the columns in slot @data to be used as x and y coordinates
func
function to apply to compute the summary statistic that is displayed if z is not given.
cond
conditioning factor (for | cond in the levelplot formula). May also be the name of the extra data column to be used for conditioning.
z
summary value to be displayed. If z is a factor, and the default color scheme (returned by matlab.palette) is used, one color per level of z is used, othe
do.print
if TRUE, the lattice object is printed with the further arguments given in print.args before returning it.
print.args
list with further arguments for printing the lattice object.
trellis.args
list with further arguments passed to levelplot.
...
further arguments passed to func by plotmap.

map.identify passes all further arguments to plotmap.

Value

  • a lattice object

Details

plotmap calculates a grid (via index.grid) on which the summary value is displayed with levelplot.

Arguments to levelplot can be given in trellis.args.

map.identify calls plotmap and waits for (left) mouse clicks on points. The row indices of the

See Also

levelplot

Examples

Run this code
background <- apply (chondro, 2, quantile, probs = 0.05)
corrected <- sweep (chondro, 2, background, "-")

plotmap (corrected, func = max)

plotmap (corrected, func = max,
         trellis.args = list (col.regions = gray ((100 : 0)/100))
        )


dist <- pearson.dist (chondro[[]])
dend <- hclust (dist, method = "ward")
z <- cutree (dend, h = 0.15)

plotmap (chondro, z = z)

plotmap (chondro, z = as.factor (z))

Run the code above in your browser using DataLab