plot_polar_smooths {rticulate}R Documentation

Plot smooths from a polar gam

Description

It plots the smooths of a polar GAM fitted with polar_gam().

Usage

plot_polar_smooths(
  model,
  series,
  comparison = NULL,
  origin = NULL,
  facet_terms = NULL,
  conditions = NULL,
  exclude_random = TRUE,
  series_length = 100,
  split = NULL,
  sep = "\\.",
  time_series
)

Arguments

model

A gam or bam model object.

series

An unquoted expression indicating the model term that defines the series on which smoothing is applied. This is the term that is displayed on the x-axis when plotting.

comparison

An unquoted expression indicating the model term for which the comparison will be plotted.

origin

The coordinates of the origin as a vector of c(x, y) coordinates.

facet_terms

An unquoted formula with the terms used for faceting.

conditions

A list of quosures with quos specifying the levels to plot from the model terms not among series, comparison, or facet_terms.

exclude_random

Whether to exclude random smooths (the default is TRUE).

series_length

An integer indicating how many values along the time series to use for predicting the outcome term.

split

Columns to separate as a named list.

sep

Separator between columns (default is "\.", which is the default with ). If character, it is interpreted as a regular expression.

time_series

Deprecated, use series instead.

Value

An object of class ggplot.

Examples


library(dplyr)
tongue_it01 <- filter(tongue, speaker == "it01")
pgam <- polar_gam(Y ~ s(X, by = as.factor(label)), data = tongue_it01)

plot_polar_smooths(pgam, X, label)


[Package rticulate version 1.7.3 Index]