From a2e35a53c9c047459b97afe5e5dfcdc32ec75a64 Mon Sep 17 00:00:00 2001 From: Joseph Larmarange Date: Fri, 5 Apr 2024 12:28:15 +0200 Subject: [PATCH 1/3] Add GitHub links to DESCRIPTION --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4c75cabb..d2324306 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -12,7 +12,7 @@ Description: Provides suite of functions to work with regression model regression model terms by variable, insert reference and header rows for categorical variables, add variable labels, and more. License: GPL (>= 3) -URL: https://larmarange.github.io/broom.helpers/ +URL: https://larmarange.github.io/broom.helpers/, https://github.com/larmarange/broom.helpers BugReports: https://github.com/larmarange/broom.helpers/issues Depends: R (>= 3.4) From dc380a3338fbf72c26c70426494bbf43fb0fd679 Mon Sep 17 00:00:00 2001 From: Joseph Larmarange Date: Fri, 5 Apr 2024 13:43:19 +0200 Subject: [PATCH 2/3] avoid error in doc --- R/select_helpers.R | 2 +- man/select_helpers.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/select_helpers.R b/R/select_helpers.R index e3112c83..712375e9 100644 --- a/R/select_helpers.R +++ b/R/select_helpers.R @@ -1,6 +1,6 @@ #' Select helper functions #' -#' @description Set of functions to supplement the {tidyselect} set of +#' @description Set of functions to supplement the *tidyselect* set of #' functions for selecting columns of data frames (and other items as well). #' - `all_continuous()` selects continuous variables #' - `all_categorical()` selects categorical (including `"dichotomous"`) variables diff --git a/man/select_helpers.Rd b/man/select_helpers.Rd index 114581d4..43a34d13 100644 --- a/man/select_helpers.Rd +++ b/man/select_helpers.Rd @@ -40,7 +40,7 @@ contrast will be selected. Default is \code{NULL}. Select among contrast types A character vector of column names selected } \description{ -Set of functions to supplement the {tidyselect} set of +Set of functions to supplement the \emph{tidyselect} set of functions for selecting columns of data frames (and other items as well). \itemize{ \item \code{all_continuous()} selects continuous variables From 651ecac81760a397026e4bbe5e91611063cfeef1 Mon Sep 17 00:00:00 2001 From: Joseph Larmarange Date: Fri, 5 Apr 2024 13:44:04 +0200 Subject: [PATCH 3/3] build readme --- README.md | 139 ++++++++++++++++++++++++++---------------------------- 1 file changed, 67 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index e7d9fc7d..78912bb2 100644 --- a/README.md +++ b/README.md @@ -58,16 +58,15 @@ library(broom.helpers) ex1 <- mod1 %>% tidy_plus_plus() ex1 #> # A tibble: 4 × 17 -#> term varia…¹ var_l…² var_c…³ var_t…⁴ var_n…⁵ contr…⁶ contr…⁷ refer…⁸ label -#> -#> 1 Sepal.W… Sepal.… Sepal.… numeric contin… NA NA Sepa… -#> 2 Species… Species Species factor catego… 3 contr.… treatm… TRUE seto… -#> 3 Species… Species Species factor catego… 3 contr.… treatm… FALSE vers… -#> 4 Species… Species Species factor catego… 3 contr.… treatm… FALSE virg… -#> # … with 7 more variables: n_obs , estimate , std.error , -#> # statistic , p.value , conf.low , conf.high , and -#> # abbreviated variable names ¹​variable, ²​var_label, ³​var_class, ⁴​var_type, -#> # ⁵​var_nlevels, ⁶​contrasts, ⁷​contrasts_type, ⁸​reference_row +#> term variable var_label var_class var_type var_nlevels contrasts +#> +#> 1 Sepal.Width Sepal.Wi… Sepal.Wi… numeric continu… NA +#> 2 Speciessetosa Species Species factor categor… 3 contr.tr… +#> 3 Speciesversicolor Species Species factor categor… 3 contr.tr… +#> 4 Speciesvirginica Species Species factor categor… 3 contr.tr… +#> # ℹ 10 more variables: contrasts_type , reference_row , label , +#> # n_obs , estimate , std.error , statistic , +#> # p.value , conf.low , conf.high dplyr::glimpse(ex1) #> Rows: 4 #> Columns: 17 @@ -98,7 +97,7 @@ mod2 <- glm( grade = contr.sum ) ) -ex2 <- mod2 %>% +ex2 <- mod2 %>% tidy_plus_plus( exponentiate = TRUE, variable_labels = c(age = "Age (in years)"), @@ -107,30 +106,28 @@ ex2 <- mod2 %>% ) ex2 #> # A tibble: 17 × 19 -#> term varia…¹ var_l…² var_c…³ var_t…⁴ var_n…⁵ heade…⁶ contr…⁷ contr…⁸ refer…⁹ -#> -#> 1 age Age (i… nmatri… contin… NA TRUE NA -#> 2 poly… age Age (i… nmatri… contin… NA FALSE NA -#> 3 poly… age Age (i… nmatri… contin… NA FALSE NA -#> 4 poly… age Age (i… nmatri… contin… NA FALSE NA -#> 5 stage T Stage factor catego… 4 TRUE contr.… treatm… NA -#> 6 stag… stage T Stage factor catego… 4 FALSE contr.… treatm… FALSE -#> 7 stag… stage T Stage factor catego… 4 FALSE contr.… treatm… FALSE -#> 8 stag… stage T Stage factor catego… 4 FALSE contr.… treatm… TRUE -#> 9 stag… stage T Stage factor catego… 4 FALSE contr.… treatm… FALSE -#> 10 grade Grade factor catego… 3 TRUE contr.… sum NA -#> 11 grad… grade Grade factor catego… 3 FALSE contr.… sum FALSE -#> 12 grad… grade Grade factor catego… 3 FALSE contr.… sum FALSE -#> 13 grad… grade Grade factor catego… 3 FALSE contr.… sum TRUE -#> 14 trtD… trt Chemot… charac… dichot… 2 NA contr.… treatm… FALSE -#> 15 grade:… Grade … intera… NA TRUE NA -#> 16 grad… grade:… Grade … intera… NA FALSE NA -#> 17 grad… grade:… Grade … intera… NA FALSE NA -#> # … with 9 more variables: label , n_obs , n_event , -#> # estimate , std.error , statistic , p.value , -#> # conf.low , conf.high , and abbreviated variable names ¹​variable, -#> # ²​var_label, ³​var_class, ⁴​var_type, ⁵​var_nlevels, ⁶​header_row, ⁷​contrasts, -#> # ⁸​contrasts_type, ⁹​reference_row +#> term variable var_label var_class var_type var_nlevels header_row contrasts +#> +#> 1 age Age (in … nmatrix.3 continu… NA TRUE +#> 2 poly(… age Age (in … nmatrix.3 continu… NA FALSE +#> 3 poly(… age Age (in … nmatrix.3 continu… NA FALSE +#> 4 poly(… age Age (in … nmatrix.3 continu… NA FALSE +#> 5 stage T Stage factor categor… 4 TRUE contr.tr… +#> 6 stage1 stage T Stage factor categor… 4 FALSE contr.tr… +#> 7 stage2 stage T Stage factor categor… 4 FALSE contr.tr… +#> 8 stage3 stage T Stage factor categor… 4 FALSE contr.tr… +#> 9 stage4 stage T Stage factor categor… 4 FALSE contr.tr… +#> 10 grade Grade factor categor… 3 TRUE contr.sum +#> 11 grade1 grade Grade factor categor… 3 FALSE contr.sum +#> 12 grade2 grade Grade factor categor… 3 FALSE contr.sum +#> 13 grade3 grade Grade factor categor… 3 FALSE contr.sum +#> 14 trtDr… trt Chemothe… character dichoto… 2 NA contr.tr… +#> 15 grade:t… Grade * … interac… NA TRUE +#> 16 grade… grade:t… Grade * … interac… NA FALSE +#> 17 grade… grade:t… Grade * … interac… NA FALSE +#> # ℹ 11 more variables: contrasts_type , reference_row , label , +#> # n_obs , n_event , estimate , std.error , +#> # statistic , p.value , conf.low , conf.high dplyr::glimpse(ex2) #> Rows: 17 #> Columns: 19 @@ -166,19 +163,18 @@ ex3 <- mod1 %>% # add term labels tidy_add_term_labels() %>% # remove intercept - tidy_remove_intercept + tidy_remove_intercept() ex3 #> # A tibble: 4 × 16 -#> term varia…¹ var_l…² var_c…³ var_t…⁴ var_n…⁵ contr…⁶ contr…⁷ refer…⁸ label -#> -#> 1 Sepal.W… Sepal.… Sepal.… numeric contin… NA NA Sepa… -#> 2 Species… Species Species factor catego… 3 contr.… treatm… TRUE seto… -#> 3 Species… Species Species factor catego… 3 contr.… treatm… FALSE vers… -#> 4 Species… Species Species factor catego… 3 contr.… treatm… FALSE virg… -#> # … with 6 more variables: estimate , std.error , statistic , -#> # p.value , conf.low , conf.high , and abbreviated variable -#> # names ¹​variable, ²​var_label, ³​var_class, ⁴​var_type, ⁵​var_nlevels, -#> # ⁶​contrasts, ⁷​contrasts_type, ⁸​reference_row +#> term variable var_label var_class var_type var_nlevels contrasts +#> +#> 1 Sepal.Width Sepal.Wi… Sepal.Wi… numeric continu… NA +#> 2 Speciessetosa Species Species factor categor… 3 contr.tr… +#> 3 Speciesversicolor Species Species factor categor… 3 contr.tr… +#> 4 Speciesvirginica Species Species factor categor… 3 contr.tr… +#> # ℹ 9 more variables: contrasts_type , reference_row , label , +#> # estimate , std.error , statistic , p.value , +#> # conf.low , conf.high dplyr::glimpse(ex3) #> Rows: 4 #> Columns: 16 @@ -212,32 +208,31 @@ ex4 <- mod2 %>% tidy_add_header_rows() ex4 #> # A tibble: 20 × 17 -#> term varia…¹ var_l…² var_c…³ var_t…⁴ var_n…⁵ heade…⁶ contr…⁷ contr…⁸ refer…⁹ -#> -#> 1 (Int… (Inter… (Inter… interc… NA NA NA -#> 2 age Age in… nmatri… contin… NA TRUE NA -#> 3 poly… age Age in… nmatri… contin… NA FALSE NA -#> 4 poly… age Age in… nmatri… contin… NA FALSE NA -#> 5 poly… age Age in… nmatri… contin… NA FALSE NA -#> 6 stage T Stage factor catego… 4 TRUE contr.… treatm… NA -#> 7 stag… stage T Stage factor catego… 4 FALSE contr.… treatm… FALSE -#> 8 stag… stage T Stage factor catego… 4 FALSE contr.… treatm… FALSE -#> 9 stag… stage T Stage factor catego… 4 FALSE contr.… treatm… TRUE -#> 10 stag… stage T Stage factor catego… 4 FALSE contr.… treatm… FALSE -#> 11 grade Grade factor catego… 3 TRUE contr.… sum NA -#> 12 grad… grade Grade factor catego… 3 FALSE contr.… sum FALSE -#> 13 grad… grade Grade factor catego… 3 FALSE contr.… sum FALSE -#> 14 grad… grade Grade factor catego… 3 FALSE contr.… sum TRUE -#> 15 trt Chemot… charac… dichot… 2 TRUE contr.… treatm… NA -#> 16 trtD… trt Chemot… charac… dichot… 2 FALSE contr.… treatm… TRUE -#> 17 trtD… trt Chemot… charac… dichot… 2 FALSE contr.… treatm… FALSE -#> 18 grade:… Grade … intera… NA TRUE NA -#> 19 grad… grade:… Grade … intera… NA FALSE NA -#> 20 grad… grade:… Grade … intera… NA FALSE NA -#> # … with 7 more variables: label , estimate , std.error , -#> # statistic , p.value , conf.low , conf.high , and -#> # abbreviated variable names ¹​variable, ²​var_label, ³​var_class, ⁴​var_type, -#> # ⁵​var_nlevels, ⁶​header_row, ⁷​contrasts, ⁸​contrasts_type, ⁹​reference_row +#> term variable var_label var_class var_type var_nlevels header_row contrasts +#> +#> 1 (Inte… (Interc… (Interce… interce… NA NA +#> 2 age Age in y… nmatrix.3 continu… NA TRUE +#> 3 poly(… age Age in y… nmatrix.3 continu… NA FALSE +#> 4 poly(… age Age in y… nmatrix.3 continu… NA FALSE +#> 5 poly(… age Age in y… nmatrix.3 continu… NA FALSE +#> 6 stage T Stage factor categor… 4 TRUE contr.tr… +#> 7 stage1 stage T Stage factor categor… 4 FALSE contr.tr… +#> 8 stage2 stage T Stage factor categor… 4 FALSE contr.tr… +#> 9 stage3 stage T Stage factor categor… 4 FALSE contr.tr… +#> 10 stage4 stage T Stage factor categor… 4 FALSE contr.tr… +#> 11 grade Grade factor categor… 3 TRUE contr.sum +#> 12 grade1 grade Grade factor categor… 3 FALSE contr.sum +#> 13 grade2 grade Grade factor categor… 3 FALSE contr.sum +#> 14 grade3 grade Grade factor categor… 3 FALSE contr.sum +#> 15 trt Chemothe… character dichoto… 2 TRUE contr.tr… +#> 16 trtDr… trt Chemothe… character dichoto… 2 FALSE contr.tr… +#> 17 trtDr… trt Chemothe… character dichoto… 2 FALSE contr.tr… +#> 18 grade:t… Grade * … interac… NA TRUE +#> 19 grade… grade:t… Grade * … interac… NA FALSE +#> 20 grade… grade:t… Grade * … interac… NA FALSE +#> # ℹ 9 more variables: contrasts_type , reference_row , label , +#> # estimate , std.error , statistic , p.value , +#> # conf.low , conf.high dplyr::glimpse(ex4) #> Rows: 20 #> Columns: 17