Learn R Programming

TidyDensity (version 1.5.0)

tidy_empirical: Tidy Empirical

Description

This function takes in a single argument of .x a vector and will return a tibble of information similar to the tidy_ distribution functions. The y column is set equal to dy from the density function.

Usage

tidy_empirical(.x, .num_sims = 1, .distribution_type = "continuous")

Value

A tibble

Arguments

.x

A vector of numbers

.num_sims

How many simulations should be run, defaults to 1.

.distribution_type

A string of either "continuous" or "discrete". The function will default to "continuous"

Author

Steven P. Sanderson II, MPH

Details

This function takes in a single argument of .x a vector

Examples

Run this code
x <- mtcars$mpg
tidy_empirical(.x = x, .distribution_type = "continuous")
tidy_empirical(.x = x, .num_sims = 10, .distribution_type = "continuous")

Run the code above in your browser using DataLab