Skip to contents

Plots an object of class 'TPSfit', with option to plot either raw or smoothed data.

Usage

# S3 method for TPSfit
plot(
  x,
  center = TRUE,
  xmin,
  xmax,
  ntime = 100,
  lab_x,
  lab_y,
  bw = FALSE,
  title,
  title_size = 15,
  axis_label_size = 15,
  axis_title_size = 15,
  legend_label_size = 15,
  strip_label_size = 15,
  type = "raw",
  ...
)

Arguments

x

Object of class 'TPSfit'.

center

Logical expression indicating whether to center data on individual trajectories.

xmin, xmax

Optional minimum and maximum values to show on x-axis.

ntime

Optional number of times to calculate fitted values for smoothed plots.

lab_x, lab_y

Optional labels for x- and y-axis.

bw

Logical expression for black and white graphic.

title

Optional title.

title_size

Optional title size.

axis_label_size

Optional size of axis labels.

axis_title_size

Optional size for axis titles.

legend_label_size

Size of legend label, if applicable

strip_label_size

Optional size for strip labels on graphics.

type

Type of plot to produce. Options are "smooth", "raw", and "all".

...

Additional arguments

Value

A plot of the raw or smoothed data.

Examples

data(TS.sim)

fitsplines <- TPSfit(TS.sim, vars=c("Var1", "Var2", "Var3"), time="Time",
     ID="SubjectID", knots_time=c(0, 91, 182, 273, 365), n_fit_times=10)
plot(fitsplines, type="smooth")