facet_wl: [!] Control facetting parameters in 'ggplot' of 'hyperSpec'...

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

View source: R/facet_wl.R

Description

Control facetting parameters in plot made with function ggplot of hyperSpec (ggplot.hyperSpec method) in which parameter wl.range is explicitly specified.

Usage

1
facet_wl(rows = ".", space = "free", scales = "free", ...)

Arguments

rows

Name of factor variable (quoted string) to be used for making rows of facets. The dot "." (default) is used to indicate that there should be no faceting on this dimension.

space

If "fixed", the default, all panels have the same size. If "free_y" their height will be proportional to the length of the y scale; if "free_x" their width will be proportional to the length of the x scale; or if "free" both height and width will vary. This setting has no effect unless the appropriate scales also vary.

scales

Are scales shared across all facets (the default, "fixed"), or do they vary across rows ("free_x"), columns ("free_y"), or both rows and columns ("free")?

...

Further parameters to be passed to facet_grid.

Details

This function is a wrapper for facet_grid and facet_grid(.~.wl.range) can be used instead of facet_wl(".").

Value

Updated ggplot2 object of class ggplot.

Author(s)

Vilmantas Gegzna

See Also

Function facet_grid from package ggplot2.

Other spPlot functions for spectroscopy and hyperSpec: ggLims(), gg_palette(), ggplot.hyperSpec(), label_expr2text()

Other spPlot functions for ggplot2: ggLims(), gg_palette(), ggplot.hyperSpec(), nTick

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(spPlot)

p <- ggplot(Spectra2, wl.range = c(min ~ 350, 500~600)) +
     geom_line(aes(color = gr))

p
p + facet_wl(space = "fixed")
p + facet_wl("class")
p + facet_wl("gr")

# Alternative to `facet_wl()` is:
p + facet_grid(. ~ .wl.range, scales = "free")

## Not run: 
# If `wl.range` is not specified, ERROR message is displayed:
p2 <- ggplot(Spectra2) + geom_line(aes(color = gr))
p2 + facet_wl()

## End(Not run)

GegznaV/spPlot documentation built on April 29, 2020, 11:06 p.m.