qualifierplot: Smart plotting of tidy data frames

Description Usage Arguments Value Examples

View source: R/autoplot.R

Description

This function uses ggplot to plot a 'long' data frame with a few id.vars, or variables that identify the values in the value column. The function is optimised to plot multi-parameter spatiotemporal data either horizontally (time on the x axis) or vertically (time on the y axis). Facets are intended to be by parameter, which is guessed based on the right-most variable named in id.vars. In the case of a qtag object, many of these values are guessed. This is intended to produce a quick visual of an object to examine its contents.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
qualifierplot(x, id.vars, measure.var, subset, xvar, yvar, facets,
  geom = "path", errors = "err", ...)

## S3 method for class 'qtag.long'
autoplot(x, ...)

## S3 method for class 'qtag.wide'
autoplot(x, ...)

## S3 method for class 'qtag.long'
plot(x, ...)

## S3 method for class 'qtag.wide'
plot(x, ...)

Arguments

x

A data.frame

id.vars

Columns that identify unique values

measure.var

Column that contains values to be plotted

subset

Subset to plot

xvar

Column to be used on the x-axis

yvar

Column to be used on the y-axis

facets

Column to be used as facetting variable

geom

GGPlot geometries to be used. Can be any combination of point, path, or line.

errors

The colum that contains uncertainty information

...

Passed on to aes_string()

Value

A ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(pocmaj)
qualifierplot(pocmaj, c("core", "depth"), "Ca")

pocmajqt <- as.qtag(pocmaj, id.vars=c("core", "depth"))
plot(pocmajqt, geom=c("path", "point"))
plot(pocmajqt, subset=core=="MAJ-1" & param %in% c("Ca", "Ti"))
plot(pocmajqt, shape="core", geom=c("path", "point"))
plot(long(pocmajqt))

library(ggplot2)
autoplot(pocmajqt, col="core")

mudata documentation built on Nov. 17, 2017, 7:30 a.m.