Learn R Programming

smatr (version 3.5-1)

make_plot_data: Build point and fitted-line data for plotting an sma fit

Description

Internal helper that assembles the data used by ggplot.sma: observed points and fitted (S)MA lines, both on the natural (back-transformed) scale of the original variables.

Usage

make_plot_data(obj, n = 100)

Value

A list with elements points (a data frame of x, y and group), lines (a data frame of the same columns describing the fitted lines) and grouped (a logical flag indicating whether the fit has a group structure).

Arguments

obj

An object of class sma.

n

Number of points used to draw each fitted line.