Learn R Programming

brokenstick (version 1.1.0)

plot_trajectory: Plot observed and fitted trajectories from fitted brokenstick model

Description

This function is called by plot.brokenstick. Normally we wouldn't call plot_trajectory() directly.

Usage

plot_trajectory(
  x,
  data,
  color_y = c(grDevices::hcl(240, 100, 40, 0.7), grDevices::hcl(240, 100, 40, 0.8)),
  size_y = 2,
  color_yhat = c(grDevices::hcl(0, 100, 40, 0.7), grDevices::hcl(0, 100, 40, 0.8)),
  size_yhat = 2,
  color_imp = c("grey80", "grey80"),
  size_imp = 2,
  ncol = 3L,
  xlab = NULL,
  ylab = NULL,
  xlim = NULL,
  ylim = NULL,
  scales = "fixed",
  theme = ggplot2::theme_light()
)

Arguments

x

An object of class brokenstick.

data

A data.frame with columns names x$names, ".source" and ".pred", and possibly ".imp"

color_y

A character vector with two elements specifying the symbol and line color of the measured data points

size_y

Dot size of measured data points

color_yhat

A character vector with two elements specifying the symbol and line color of the predicted data points

size_yhat

Dot size of predicted data points

color_imp

A character vector with two elements specifying the symbol and line color of the imputed data

size_imp

Dot size of imputed data

ncol

Number of columns in plot

xlab

The label of the x-axis

ylab

The label of the y-axis

xlim

Vector of length 2 with range of x-axis

ylim

Vector of length 2 with range of y-axis

scales

Axis scaling, e.g. "fixed", "free", and so on

theme

Plotting theme

Value

An object of class ggplot

See Also

plot.brokenstick