poly_plot {polypoly} | R Documentation |
Plot a polynomial matrix
Description
Plot a polynomial matrix
Usage
poly_plot(x, by_observation = TRUE, x_col = 1)
poly_plot_data(x, by_observation = TRUE, x_col = 1)
Arguments
x |
a matrix created by |
by_observation |
whether the x axis should be mapped to the
observation/row number ( |
x_col |
integer indicating which column to plot as the x-axis when
|
Value
a ggplot2::ggplot()
plot of the degree terms from the matrix. For
poly_plot_data()
, the dataframe used to create the plot is returned
instead.
Examples
# Defaults to plotting using the row number as x-axis
m <- poly(1:100, degree = 3)
poly_plot(m)
# Not good because observations were not sorted
m2 <- poly(rnorm(100), degree = 3)
poly_plot(m2)
# Instead set by_observation to FALSE to plot along the degree 1 values
poly_plot(m2, by_observation = FALSE)
# Get a dataframe instead of plot
poly_plot_data(m2, by_observation = FALSE)
[Package polypoly version 0.0.3 Index]