lccPlot: Plot Fitted Curves from an 'lcc' Object

View source: R/plotmethod_lcc.R

lccPlotR Documentation

Plot Fitted Curves from an lcc Object

Description

This function generates a plot of predictions versus the time covariate for an lcc object. Predicted values are connected by lines, while actual observations are denoted by circles. If components=TRUE was used in the lcc object, individual plots for each statistic (LCC, LPC, and LA) are produced on separate pages.

Usage

lccPlot(obj, type = "lcc", control = list(), ...)

Arguments

obj

An object inheriting from class "lcc", representing a fitted lcc model.

type

Character string specifying the type of plot to generate.

  • "lcc": Produces the LCC plot.

  • "lpc": Produces the LPC plot. Available only if components = TRUE.

  • "la": Produces the LA plot. Available only if components = TRUE.

control

A list of graphical control values or character strings returned by the plotControl function. Defaults to an empty list. The list can contain components like shape, colour, size, xlab, ylab, scale_y_continuous, and all.plot.

...

Additional arguments passed to the facet_wrap function.

Value

An object of class ggplot or viewport, depending on the all.plot setting in control.

Author(s)

Thiago de Paula Oliveira, thiago.paula.oliveira@alumni.usp.br

See Also

lcc, plotControl

Examples

data(hue)
# Second degree polynomial model with random intercept, slope and quadratic term
fm1 <- lcc(data = hue, subject = "Fruit", resp = "H_mean",
          method = "Method", time = "Time", qf = 2, qr = 2, components = TRUE)
lccPlot(fm1, type = "lcc")
lccPlot(fm1, type = "lpc")
lccPlot(fm1, type = "la")

# Using ggplot2 themes
lccPlot(fm1, type = "lpc") + theme_bw() + labs(x = "Time (Days)", y = "LPC Value")

# Generating and saving plots
## Not run: 
  ggsave("lccPlot.pdf", lccPlot(fm1, type = "lcc"))

## End(Not run)


Prof-ThiagoOliveira/lcc documentation built on Dec. 9, 2023, 12:10 a.m.