#' @export
fourplot <- function(x){
n <- length(x)
a <- x[-1]
b <- x[1:(length(x))]
b <- b[-(length(x))]
par(mfrow=c(2,2))
# first plot of y[i] vs. i.
plot(x, main = "Sequence Plot", xlab = "i", ylab = "y[i]")
# second plot of y[i] vs. y[i-1].
plot(a, b, main = "Lag Plot", xlab = "y[i-1]", ylab = "[i]")
# third plot a histogram of y.
hist(x, main = "Histogram of y", xlab = "y", ylab = "Counts")
# fourth plot a normal probability plot of y.
qqnorm(x, main ="Normal probability plot", xlab = "Theoretical values from a
standard normal distribution", ylab = "Ordered y[i]")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.