knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-" )
library(ggplot2) x <- poly(1:10000, degree = 6) df <- polypoly::poly_melt(x) df$dg <- as.numeric(df$degree) ggplot(df) + aes(x = observation, y = value, color = dg, group = dg) + geom_line(size = 1) + viridis::scale_color_viridis(option = "viridis") + theme_void() + guides(color = "none") + coord_cartesian(xlim = NULL, ylim = NULL, expand = FALSE)
Helper functions for polynomials created by poly()
.
Install the latest release of polypoly from CRAN:
install.packages("polypoly")
Or install the developmental version from Github:
# install.packages("devtools") devtools::install_github("tjmahr/polypoly")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.