Lays a smart_cor() result out as a one-row tibble in the manner of the
broom package, so results drop straight into a dplyr pipeline.
Usage
# S3 method for class 'smartcor'
tidy(x, ...)Value
A one-row tibble::tibble() with columns covering identifiers
(var_x, var_y, x_type, y_type), the point estimate, the chosen
method (method, method_label, rationale), inference details
(statistic, p.value, p_method, null_hypothesis, p_interpretation,
ci_lower, ci_upper, conf_level, ci_method, ci_source), sample
sizes (n, n_complete), and diagnostic summaries (outlier_flag,
normality_p, latent_p, linearity_p; NA when not computed).
Examples
csv = system.file("extdata", "gss_2024_casestudy.csv", package = "smartcor")
gss = read.csv(csv)
res = smart_cor(gss$coninc, gss$age, verbose = FALSE)
tidy(res)
#> # A tibble: 1 × 24
#> var_x var_y x_type y_type estimate method method_label rationale statistic
#> <chr> <chr> <chr> <chr> <dbl> <chr> <chr> <chr> <dbl>
#> 1 gss$coni… gss$… conti… count 0.0369 spear… Spearman Ra… Sorted r… 4.33e9
#> # ℹ 15 more variables: p.value <dbl>, p_method <chr>, null_hypothesis <chr>,
#> # p_interpretation <chr>, ci_lower <dbl>, ci_upper <dbl>, conf_level <dbl>,
#> # ci_method <chr>, ci_source <chr>, n <int>, n_complete <int>,
#> # outlier_flag <lgl>, normality_p <dbl>, latent_p <dbl>, linearity_p <dbl>