knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figure/" ) options(scipen = 1, digits = 1) set.seed(2017)
A simple class for ranges/intervals. Upon the S3 class range
, one could define confidence/prediction intervals in a compact way, i.e. one column instead of three (including lower, upper and level). It provides the back-end for tbl_forecast
in the tsibble package.
You could install the development version from Github using
# install.packages("devtools") devtools::install_github("earowang/hilo")
library(hilo) x <- rnorm(15) y <- x + rnorm(15) newdat <- data.frame(x = seq(-3, 3, length.out = 10)) pred <- as.data.frame(predict(lm(y ~ x), newdat, interval = "prediction")) pred$PI <- bind_rng(lower = pred$lwr, upper = pred$upr, level = 95L) pred
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.