inst/doc/LSTbook.R

## ---- include = FALSE---------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup, include = FALSE---------------------------------------------------
library(LSTbook)
library(dplyr)
library(ggplot2)

## -----------------------------------------------------------------------------
mtcars |> point_plot(mpg ~ hp, annot = "model")

## -----------------------------------------------------------------------------
mtcars |> 
  dplyr::mutate(consumption = 235.2 / mpg) |>
  model_train(consumption ~ hp + wt) |> 
  conf_interval()

## -----------------------------------------------------------------------------
mtcars |> 
  point_plot(mpg ~ hp * wt) |> 
  add_plot_labels(x = "Engine power (hp)", y = "Fuel economy (mpg)")

## -----------------------------------------------------------------------------
sim_06

## -----------------------------------------------------------------------------
mtcars |> 
  take_sample(replace = TRUE) |> # resampling here!
  model_train(mpg ~ hp) |> 
  conf_interval() |> 
  filter(term == "hp") |>
  trials(5) 
  

Try the LSTbook package in your browser

Any scripts or data that you put into this service are public.

LSTbook documentation built on April 3, 2025, 6:02 p.m.