Skip to content

Instantly share code, notes, and snippets.

@ericnovik
Last active August 29, 2015 13:56
Show Gist options
  • Save ericnovik/9240859 to your computer and use it in GitHub Desktop.
Save ericnovik/9240859 to your computer and use it in GitHub Desktop.
order <- 10
x <- seq(0, 2*pi, 0.01)
y <- cos(x)
y_poly <- poly(y, order, raw = TRUE)
plot(y_poly[, 1], col = 1, type = "l", xlab = "", ylab = "", axes = FALSE)
for (i in 2:order) {
lines(y_poly[, i], col = i)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment