plot_facet: Facet plot

Description Usage Arguments Details Value Examples

Description

Scatterplot or histogram faceted by groups.

Usage

1
2
plot_facet(data, x, y, by, free = "none", type = "plot",
  qline = TRUE, ...)

Arguments

data

data.frame in long format.

x, y

name of variable in data for which values are plotted.

by

name of grouping variable in data.

free

one of c('none','x','y','xy'), defining which axes will freely vary; otherwise axes will be identical among all facets.

type

one of 'plot' or 'hist', defining which type of plot.

qline

if type = 'hist', then qline = TRUE will plot vertical lines at the 25/50/75th percentiles.

...

further arguments passed to plotting functions.

Details

Useful for disaggregating by some grouping variable, either as a bivariate scatterplot ('type = plot') or univariate histogram ('type = hist').

Value

Plots to device.

Examples

1
2
3
4
5
6
7
8
9
data(est)
x  <- calc_biomass(est)
fg <- summary_fg(x, eachplot=TRUE)
fg$logmass <- log10(fg$mass+1)
plot_facet(fg, 'cover', 'mass', by='fg', type='plot',
           xlab='Plot cover (%)',
           ylab=bquote('Biomass (kg' ~ha^-1*')'))
plot_facet(fg, 'logmass', by='fg', type='hist', breaks=33,
           xlab='Biomass', ylab='Frequency')

phytomosaic/grlyr documentation built on May 25, 2020, 7:04 p.m.