Listing Functions and Parameters

code
rtip
dplyr
Author

Steven P. Sanderson II, MPH

Published

December 22, 2022

Introduction

I got a little bored one day and decided I wanted to list out all of the functions inside of a package along with their parameters in a tibble. Not sure if this serves any particular purpose or not, I was just bored.

This does not work for packages that have data as an export like {healthyR} or {healthyR.data} but it will work for packages like {TidyDensity}.

Let’s run through it

Examples

Here we go.

library(TidyDensity)

dplyr::tibble(fns = ls(paste0("package:TidyDensity"))) |>
  dplyr::group_by(fns) |>
  dplyr::mutate(params = purrr::map(fns, formalArgs) |>
           toString()) |>
  dplyr::mutate(func_with_params = stringr::str_remove(params, "c")) |>
  dplyr::mutate(func_with_params = ifelse(
    stringr::str_detect(
      func_with_params, "\\("), 
      paste0(fns, func_with_params), 
      paste0(fns, "(", func_with_params, ")")
    )) |>
  dplyr::ungroup() |>
  knitr::kable()
fns params func_with_params
%>% c(“lhs”, “rhs”) %>%(“lhs”, “rhs”)
:= c(“x”, “y”) :=(“x”, “y”)
as_label x as_label(x)
as_name x as_name(x)
bootstrap_density_augment .data bootstrap_density_augment(.data)
bootstrap_p_augment c(“.data”, “.value”, “.names”) bootstrap_p_augment(“.data”, “.value”, “.names”)
bootstrap_p_vec .x bootstrap_p_vec(.x)
bootstrap_q_augment c(“.data”, “.value”, “.names”) bootstrap_q_augment(“.data”, “.value”, “.names”)
bootstrap_q_vec .x bootstrap_q_vec(.x)
bootstrap_stat_plot c(“.data”, “.value”, “.stat”, “.show_groups”, “.show_ci_labels”, “.interactive”) bootstrap_stat_plot(“.data”, “.value”, “.stat”, “.show_groups”, “.show_ci_labels”, “.interactive”)
bootstrap_unnest_tbl .data bootstrap_unnest_tbl(.data)
cgmean .x cgmean(.x)
chmean .x chmean(.x)
ci_hi c(“.x”, “.na_rm”) ci_hi(“.x”, “.na_rm”)
ci_lo c(“.x”, “.na_rm”) ci_lo(“.x”, “.na_rm”)
ckurtosis .x ckurtosis(.x)
cmean .x cmean(.x)
cmedian .x cmedian(.x)
color_blind NULL color_blind(NULL)
csd .x csd(.x)
cskewness .x cskewness(.x)
cvar .x cvar(.x)
dist_type_extractor .x dist_type_extractor(.x)
enquo arg enquo(arg)
enquos c(“…”, “.named”, “.ignore_empty”, “.unquote_names”, “.homonyms”, “.check_assign”) enquos(“…”, “.named”, “.ignore_empty”, “.unquote_names”, “.homonyms”, “.check_assign”)
td_scale_color_colorblind c(“…”, “theme”) td_scale_color_colorblind(“…”, “theme”)
td_scale_fill_colorblind c(“…”, “theme”) td_scale_fill_colorblind(“…”, “theme”)
tidy_autoplot c(“.data”, “.plot_type”, “.line_size”, “.geom_point”, “.point_size”, “.geom_rug”, “.geom_smooth”, “.geom_jitter”, “.interactive”) tidy_autoplot(“.data”, “.plot_type”, “.line_size”, “.geom_point”, “.point_size”, “.geom_rug”, “.geom_smooth”, “.geom_jitter”, “.interactive”)
tidy_bernoulli c(“.n”, “.prob”, “.num_sims”) tidy_bernoulli(“.n”, “.prob”, “.num_sims”)
tidy_beta c(“.n”, “.shape1”, “.shape2”, “.ncp”, “.num_sims”) tidy_beta(“.n”, “.shape1”, “.shape2”, “.ncp”, “.num_sims”)
tidy_binomial c(“.n”, “.size”, “.prob”, “.num_sims”) tidy_binomial(“.n”, “.size”, “.prob”, “.num_sims”)
tidy_bootstrap c(“.x”, “.num_sims”, “.proportion”, “.distribution_type”) tidy_bootstrap(“.x”, “.num_sims”, “.proportion”, “.distribution_type”)
tidy_burr c(“.n”, “.shape1”, “.shape2”, “.rate”, “.scale”, “.num_sims”) tidy_burr(“.n”, “.shape1”, “.shape2”, “.rate”, “.scale”, “.num_sims”)
tidy_cauchy c(“.n”, “.location”, “.scale”, “.num_sims”) tidy_cauchy(“.n”, “.location”, “.scale”, “.num_sims”)
tidy_chisquare c(“.n”, “.df”, “.ncp”, “.num_sims”) tidy_chisquare(“.n”, “.df”, “.ncp”, “.num_sims”)
tidy_combine_distributions tidy_combine_distributions(…)
tidy_combined_autoplot c(“.data”, “.plot_type”, “.line_size”, “.geom_point”, “.point_size”, “.geom_rug”, “.geom_smooth”, “.geom_jitter”, “.interactive”) tidy_combined_autoplot(“.data”, “.plot_type”, “.line_size”, “.geom_point”, “.point_size”, “.geom_rug”, “.geom_smooth”, “.geom_jitter”, “.interactive”)
tidy_distribution_comparison c(“.x”, “.distribution_type”) tidy_distribution_comparison(“.x”, “.distribution_type”)
tidy_distribution_summary_tbl c(“.data”, “…”) tidy_distribution_summary_tbl(“.data”, “…”)
tidy_empirical c(“.x”, “.num_sims”, “.distribution_type”) tidy_empirical(“.x”, “.num_sims”, “.distribution_type”)
tidy_exponential c(“.n”, “.rate”, “.num_sims”) tidy_exponential(“.n”, “.rate”, “.num_sims”)
tidy_f c(“.n”, “.df1”, “.df2”, “.ncp”, “.num_sims”) tidy_f(“.n”, “.df1”, “.df2”, “.ncp”, “.num_sims”)
tidy_four_autoplot c(“.data”, “.line_size”, “.geom_point”, “.point_size”, “.geom_rug”, “.geom_smooth”, “.geom_jitter”, “.interactive”) tidy_four_autoplot(“.data”, “.line_size”, “.geom_point”, “.point_size”, “.geom_rug”, “.geom_smooth”, “.geom_jitter”, “.interactive”)
tidy_gamma c(“.n”, “.shape”, “.scale”, “.num_sims”) tidy_gamma(“.n”, “.shape”, “.scale”, “.num_sims”)
tidy_generalized_beta c(“.n”, “.shape1”, “.shape2”, “.shape3”, “.rate”, “.scale”, “.num_sims”) tidy_generalized_beta(“.n”, “.shape1”, “.shape2”, “.shape3”, “.rate”, “.scale”, “.num_sims”)
tidy_generalized_pareto c(“.n”, “.shape1”, “.shape2”, “.rate”, “.scale”, “.num_sims”) tidy_generalized_pareto(“.n”, “.shape1”, “.shape2”, “.rate”, “.scale”, “.num_sims”)
tidy_geometric c(“.n”, “.prob”, “.num_sims”) tidy_geometric(“.n”, “.prob”, “.num_sims”)
tidy_hypergeometric c(“.n”, “.m”, “.nn”, “.k”, “.num_sims”) tidy_hypergeometric(“.n”, “.m”, “.nn”, “.k”, “.num_sims”)
tidy_inverse_burr c(“.n”, “.shape1”, “.shape2”, “.rate”, “.scale”, “.num_sims”) tidy_inverse_burr(“.n”, “.shape1”, “.shape2”, “.rate”, “.scale”, “.num_sims”)
tidy_inverse_exponential c(“.n”, “.rate”, “.scale”, “.num_sims”) tidy_inverse_exponential(“.n”, “.rate”, “.scale”, “.num_sims”)
tidy_inverse_gamma c(“.n”, “.shape”, “.rate”, “.scale”, “.num_sims”) tidy_inverse_gamma(“.n”, “.shape”, “.rate”, “.scale”, “.num_sims”)
tidy_inverse_normal c(“.n”, “.mean”, “.shape”, “.dispersion”, “.num_sims”) tidy_inverse_normal(“.n”, “.mean”, “.shape”, “.dispersion”, “.num_sims”)
tidy_inverse_pareto c(“.n”, “.shape”, “.scale”, “.num_sims”) tidy_inverse_pareto(“.n”, “.shape”, “.scale”, “.num_sims”)
tidy_inverse_weibull c(“.n”, “.shape”, “.rate”, “.scale”, “.num_sims”) tidy_inverse_weibull(“.n”, “.shape”, “.rate”, “.scale”, “.num_sims”)
tidy_kurtosis_vec .x tidy_kurtosis_vec(.x)
tidy_logistic c(“.n”, “.location”, “.scale”, “.num_sims”) tidy_logistic(“.n”, “.location”, “.scale”, “.num_sims”)
tidy_lognormal c(“.n”, “.meanlog”, “.sdlog”, “.num_sims”) tidy_lognormal(“.n”, “.meanlog”, “.sdlog”, “.num_sims”)
tidy_mixture_density tidy_mixture_density(…)
tidy_multi_dist_autoplot c(“.data”, “.plot_type”, “.line_size”, “.geom_point”, “.point_size”, “.geom_rug”, “.geom_smooth”, “.geom_jitter”, “.interactive”) tidy_multi_dist_autoplot(“.data”, “.plot_type”, “.line_size”, “.geom_point”, “.point_size”, “.geom_rug”, “.geom_smooth”, “.geom_jitter”, “.interactive”)
tidy_multi_single_dist c(“.tidy_dist”, “.param_list”) tidy_multi_single_dist(“.tidy_dist”, “.param_list”)
tidy_negative_binomial c(“.n”, “.size”, “.prob”, “.num_sims”) tidy_negative_binomial(“.n”, “.size”, “.prob”, “.num_sims”)
tidy_normal c(“.n”, “.mean”, “.sd”, “.num_sims”) tidy_normal(“.n”, “.mean”, “.sd”, “.num_sims”)
tidy_paralogistic c(“.n”, “.shape”, “.rate”, “.scale”, “.num_sims”) tidy_paralogistic(“.n”, “.shape”, “.rate”, “.scale”, “.num_sims”)
tidy_pareto c(“.n”, “.shape”, “.scale”, “.num_sims”) tidy_pareto(“.n”, “.shape”, “.scale”, “.num_sims”)
tidy_pareto1 c(“.n”, “.shape”, “.min”, “.num_sims”) tidy_pareto1(“.n”, “.shape”, “.min”, “.num_sims”)
tidy_poisson c(“.n”, “.lambda”, “.num_sims”) tidy_poisson(“.n”, “.lambda”, “.num_sims”)
tidy_random_walk c(“.data”, “.initial_value”, “.sample”, “.replace”, “.value_type”) tidy_random_walk(“.data”, “.initial_value”, “.sample”, “.replace”, “.value_type”)
tidy_random_walk_autoplot c(“.data”, “.line_size”, “.geom_rug”, “.geom_smooth”, “.interactive”) tidy_random_walk_autoplot(“.data”, “.line_size”, “.geom_rug”, “.geom_smooth”, “.interactive”)
tidy_range_statistic .x tidy_range_statistic(.x)
tidy_scale_zero_one_vec .x tidy_scale_zero_one_vec(.x)
tidy_skewness_vec .x tidy_skewness_vec(.x)
tidy_stat_tbl c(“.data”, “.x”, “.fns”, “.return_type”, “.use_data_table”, “…”) tidy_stat_tbl(“.data”, “.x”, “.fns”, “.return_type”, “.use_data_table”, “…”)
tidy_t c(“.n”, “.df”, “.ncp”, “.num_sims”) tidy_t(“.n”, “.df”, “.ncp”, “.num_sims”)
tidy_uniform c(“.n”, “.min”, “.max”, “.num_sims”) tidy_uniform(“.n”, “.min”, “.max”, “.num_sims”)
tidy_weibull c(“.n”, “.shape”, “.scale”, “.num_sims”) tidy_weibull(“.n”, “.shape”, “.scale”, “.num_sims”)
tidy_zero_truncated_binomial c(“.n”, “.size”, “.prob”, “.num_sims”) tidy_zero_truncated_binomial(“.n”, “.size”, “.prob”, “.num_sims”)
tidy_zero_truncated_geometric c(“.n”, “.prob”, “.num_sims”) tidy_zero_truncated_geometric(“.n”, “.prob”, “.num_sims”)
tidy_zero_truncated_negative_binomial c(“.n”, “.size”, “.prob”, “.num_sims”) tidy_zero_truncated_negative_binomial(“.n”, “.size”, “.prob”, “.num_sims”)
tidy_zero_truncated_poisson c(“.n”, “.lambda”, “.num_sims”) tidy_zero_truncated_poisson(“.n”, “.lambda”, “.num_sims”)
util_bernoulli_param_estimate c(“.x”, “.auto_gen_empirical”) util_bernoulli_param_estimate(“.x”, “.auto_gen_empirical”)
util_bernoulli_stats_tbl .data util_bernoulli_stats_tbl(.data)
util_beta_param_estimate c(“.x”, “.auto_gen_empirical”) util_beta_param_estimate(“.x”, “.auto_gen_empirical”)
util_beta_stats_tbl .data util_beta_stats_tbl(.data)
util_binomial_param_estimate c(“.x”, “.size”, “.auto_gen_empirical”) util_binomial_param_estimate(“.x”, “.size”, “.auto_gen_empirical”)
util_binomial_stats_tbl .data util_binomial_stats_tbl(.data)
util_cauchy_param_estimate c(“.x”, “.auto_gen_empirical”) util_cauchy_param_estimate(“.x”, “.auto_gen_empirical”)
util_cauchy_stats_tbl .data util_cauchy_stats_tbl(.data)
util_chisquare_stats_tbl .data util_chisquare_stats_tbl(.data)
util_exponential_param_estimate c(“.x”, “.auto_gen_empirical”) util_exponential_param_estimate(“.x”, “.auto_gen_empirical”)
util_exponential_stats_tbl .data util_exponential_stats_tbl(.data)
util_f_stats_tbl .data util_f_stats_tbl(.data)
util_gamma_param_estimate c(“.x”, “.auto_gen_empirical”) util_gamma_param_estimate(“.x”, “.auto_gen_empirical”)
util_gamma_stats_tbl .data util_gamma_stats_tbl(.data)
util_geometric_param_estimate c(“.x”, “.auto_gen_empirical”) util_geometric_param_estimate(“.x”, “.auto_gen_empirical”)
util_geometric_stats_tbl .data util_geometric_stats_tbl(.data)
util_hypergeometric_param_estimate c(“.x”, “.m”, “.total”, “.k”, “.auto_gen_empirical”) util_hypergeometric_param_estimate(“.x”, “.m”, “.total”, “.k”, “.auto_gen_empirical”)
util_hypergeometric_stats_tbl .data util_hypergeometric_stats_tbl(.data)
util_logistic_param_estimate c(“.x”, “.auto_gen_empirical”) util_logistic_param_estimate(“.x”, “.auto_gen_empirical”)
util_logistic_stats_tbl .data util_logistic_stats_tbl(.data)
util_lognormal_param_estimate c(“.x”, “.auto_gen_empirical”) util_lognormal_param_estimate(“.x”, “.auto_gen_empirical”)
util_lognormal_stats_tbl .data util_lognormal_stats_tbl(.data)
util_negative_binomial_param_estimate c(“.x”, “.size”, “.auto_gen_empirical”) util_negative_binomial_param_estimate(“.x”, “.size”, “.auto_gen_empirical”)
util_negative_binomial_stats_tbl .data util_negative_binomial_stats_tbl(.data)
util_normal_param_estimate c(“.x”, “.auto_gen_empirical”) util_normal_param_estimate(“.x”, “.auto_gen_empirical”)
util_normal_stats_tbl .data util_normal_stats_tbl(.data)
util_pareto_param_estimate c(“.x”, “.auto_gen_empirical”) util_pareto_param_estimate(“.x”, “.auto_gen_empirical”)
util_pareto_stats_tbl .data util_pareto_stats_tbl(.data)
util_poisson_param_estimate c(“.x”, “.auto_gen_empirical”) util_poisson_param_estimate(“.x”, “.auto_gen_empirical”)
util_poisson_stats_tbl .data util_poisson_stats_tbl(.data)
util_t_stats_tbl .data util_t_stats_tbl(.data)
util_uniform_param_estimate c(“.x”, “.auto_gen_empirical”) util_uniform_param_estimate(“.x”, “.auto_gen_empirical”)
util_uniform_stats_tbl .data util_uniform_stats_tbl(.data)
util_weibull_param_estimate c(“.x”, “.auto_gen_empirical”) util_weibull_param_estimate(“.x”, “.auto_gen_empirical”)
util_weibull_stats_tbl .data util_weibull_stats_tbl(.data)

Another example.

library(healthyverse)

library(TidyDensity)

dplyr::tibble(fns = ls(paste0("package:healthyverse"))) |>
  dplyr::group_by(fns) |>
  dplyr::mutate(params = purrr::map(fns, formalArgs) |>
           toString()) |>
  dplyr::mutate(func_with_params = stringr::str_remove(params, "c")) |>
  dplyr::mutate(func_with_params = ifelse(
    stringr::str_detect(
      func_with_params, "\\("), 
      paste0(fns, func_with_params), 
      paste0(fns, "(", func_with_params, ")")
    )) |>
  dplyr::ungroup() |>
  knitr::kable()
fns params func_with_params
%>% c(“lhs”, “rhs”) %>%(“lhs”, “rhs”)
:= c(“x”, “y”) :=(“x”, “y”)
as_label x as_label(x)
as_name x as_name(x)
enquo arg enquo(arg)
enquos c(“…”, “.named”, “.ignore_empty”, “.unquote_names”, “.homonyms”, “.check_assign”) enquos(“…”, “.named”, “.ignore_empty”, “.unquote_names”, “.homonyms”, “.check_assign”)
expr expr expr(expr)
healthyverse_conflicts NULL healthyverse_conflicts(NULL)
healthyverse_deps c(“recursive”, “repos”) healthyverse_deps(“recursive”, “repos”)
healthyverse_packages include_self healthyverse_packages(inlude_self)
healthyverse_sitrep NULL healthyverse_sitrep(NULL)
healthyverse_update c(“recursive”, “repos”) healthyverse_update(“recursive”, “repos”)
sym x sym(x)
syms x syms(x)

Voila!