Skip to contents

This function will return a tibble that can either be nested/unnested, and grouped or ungrouped. The .data argument must be the output of the hai_distribution_comparison_tbl() function.

Usage

hai_get_dist_data_tbl(.data, .unnest = TRUE, .group_data = FALSE)

Arguments

.data

The data from the hai_distribution_comparison_tbl() function as this function looks for a class of 'hai_dist_data'

.unnest

Should the resulting tibble be unnested, a boolean value TRUE/FALSE. The default is TRUE

.group_data

Shold the resulting tibble be grouped, a boolean value TRUE/FALSE. The default is FALSE

Value

A tibble.

Details

This function expects to take the output of the hai_distribution_comparison_tbl() function. It returns a tibble of the distribution and the randomly generated data produced from the associated stats r function like rnorm

See also

Author

Steven P. Sanderson II, MPH

Examples

library(dplyr)

df <- hai_scale_zero_one_vec(.x = mtcars$mpg) %>%
  hai_distribution_comparison_tbl()
hai_get_dist_data_tbl(df)
#> # A tibble: 96 × 2
#>    distribution dist_data
#>    <chr>            <dbl>
#>  1 gamma          0.00211
#>  2 gamma          0.133  
#>  3 gamma          0.0426 
#>  4 gamma          0.0340 
#>  5 gamma          0.456  
#>  6 gamma          0.0329 
#>  7 gamma          0.239  
#>  8 gamma          0.0916 
#>  9 gamma          0.798  
#> 10 gamma          0.666  
#> # ℹ 86 more rows