View source: R/polypoly-package.R
poly_plot | R Documentation |
Plot a polynomial matrix
poly_plot(x, by_observation = TRUE, x_col = 1) poly_plot_data(x, by_observation = TRUE, x_col = 1)
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
|
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.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.