distlearn: R4VN Distribution Learning Studio

View source: R/distlearn.R

distlearnR Documentation

R4VN Distribution Learning Studio

Description

Launches an interactive Shiny application for learning probability distributions. The interface is inspired by the idea of a distribution explorer, but is designed around the R4VN teaching workflow: change parameters, immediately see the distribution, calculate commonly used probability statements, read historical and practical context, simulate data, and copy an equivalent distdata() command.

Usage

distlearn(
  distribution = "normal",
  launch.browser = interactive(),
  port = NULL,
  host = "127.0.0.1"
)

Arguments

distribution

Initial distribution name. Defaults to "normal".

launch.browser

Passed to shiny::runApp().

port

Optional port passed to shiny::runApp().

host

Host passed to shiny::runApp().

Details

The Studio currently includes the continuous distributions Normal, Log-normal, Uniform, Exponential, Gamma, Beta, Chi-square, Student's t, F, Weibull, Logistic, Cauchy, Laplace, Gumbel, Pareto, Rayleigh, Triangular, Kumaraswamy, Log-logistic, and Half-normal; and the discrete distributions Bernoulli, Binomial, Poisson, Geometric, Negative binomial, Hypergeometric, Discrete uniform, Beta-binomial, Zero-inflated Poisson, finite Zipf, and Logarithmic series.

Each distribution has an interactive probability/density plot and CDF, numerical characteristics, parameter explanations, a historical note, typical applications, cautions, probability/quantile calculation, and simulation. Parameter values may be controlled with sliders or typed directly using numeric inputs.

Value

Invisibly returns the result of shiny::runApp() when the app exits.

Examples

if (interactive()) {
  distlearn("binomial")
}

R4VN documentation built on Sept. 30, 2026, 5:13 p.m.