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.0469  
#>  2 gamma         0.00187 
#>  3 gamma         0.211   
#>  4 gamma         0.0252  
#>  5 gamma         0.554   
#>  6 gamma         0.0646  
#>  7 gamma         0.0890  
#>  8 gamma         0.260   
#>  9 gamma         0.425   
#> 10 gamma         0.000101
#> # ℹ 86 more rows