From 67a3534c3e61d079f11e338bbb4bc7896a30bfac Mon Sep 17 00:00:00 2001 From: agdamsbo <43278243+agdamsbo@users.noreply.github.com> Date: Wed, 19 Feb 2025 12:39:19 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20agdamsbo?= =?UTF-8?q?/freesearcheR@c4b5a7ba7908602288370fdca474bf553446dde5=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgdown.yml | 2 +- reference/clean_date.html | 78 +++++++++ reference/clean_sep.html | 86 ++++++++++ reference/data-correlations.html | 97 ++++++++++++ reference/data-summary.html | 8 +- reference/data_correlations_server.html | 8 + reference/data_correlations_ui.html | 8 + reference/get_fun_options.html | 118 ++++++++++++++ reference/getfun.html | 2 +- reference/gg_theme_export.html | 78 +++++++++ reference/gg_theme_shiny.html | 78 +++++++++ reference/index.html | 86 +++++++++- reference/launch.html | 78 +++++++++ reference/merge_long.html | 82 ++++++++++ reference/outcome_type.html | 118 ++++++++++++++ reference/plot.tbl_regression.html | 95 +++++++++++ reference/possible_functions.html | 93 +++++++++++ reference/regression_model.html | 200 ++++++++++++++++++------ reference/regression_model_list.html | 8 + reference/regression_model_uv.html | 130 +-------------- reference/regression_model_uv_list.html | 8 + reference/regression_table.html | 8 +- reference/remove_empty_cols.html | 98 ++++++++++++ reference/supported_functions.html | 168 ++++++++++++++++++++ search.json | 2 +- sitemap.xml | 14 +- 26 files changed, 1566 insertions(+), 185 deletions(-) create mode 100644 reference/clean_date.html create mode 100644 reference/clean_sep.html create mode 100644 reference/data-correlations.html create mode 100644 reference/data_correlations_server.html create mode 100644 reference/data_correlations_ui.html create mode 100644 reference/get_fun_options.html create mode 100644 reference/gg_theme_export.html create mode 100644 reference/gg_theme_shiny.html create mode 100644 reference/launch.html create mode 100644 reference/merge_long.html create mode 100644 reference/outcome_type.html create mode 100644 reference/plot.tbl_regression.html create mode 100644 reference/possible_functions.html create mode 100644 reference/regression_model_list.html create mode 100644 reference/regression_model_uv_list.html create mode 100644 reference/remove_empty_cols.html create mode 100644 reference/supported_functions.html diff --git a/pkgdown.yml b/pkgdown.yml index 2631970..a7fb6d2 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.11 pkgdown: 2.1.1 pkgdown_sha: ~ articles: {} -last_built: 2025-02-18T10:53Z +last_built: 2025-02-19T12:39Z urls: reference: https://agdamsbo.github.io/freesearcheR/reference article: https://agdamsbo.github.io/freesearcheR/articles diff --git a/reference/clean_date.html b/reference/clean_date.html new file mode 100644 index 0000000..ead4f00 --- /dev/null +++ b/reference/clean_date.html @@ -0,0 +1,78 @@ + +Attempts at applying uniform date format — clean_date • freesearcheR + Skip to contents + + +
+
+
+ +
+

Attempts at applying uniform date format

+
+ +
+

Usage

+
clean_date(data)
+
+ +
+

Arguments

+ + +
data
+

character string vector of possible dates

+ +
+
+

Value

+

character string

+
+ +
+ + +
+ + + + + + + diff --git a/reference/clean_sep.html b/reference/clean_sep.html new file mode 100644 index 0000000..dee97f6 --- /dev/null +++ b/reference/clean_sep.html @@ -0,0 +1,86 @@ + +gsub wrapper for piping with default values for separator substituting — clean_sep • freesearcheR + Skip to contents + + +
+
+
+ +
+

gsub wrapper for piping with default values for separator substituting

+
+ +
+

Usage

+
clean_sep(data, old.sep = "[-.,/]", new.sep = "-")
+
+ +
+

Arguments

+ + +
data
+

character vector

+ + +
old.sep
+

old separator

+ + +
new.sep
+

new separator

+ +
+
+

Value

+

character vector

+
+ +
+ + +
+ + + + + + + diff --git a/reference/data-correlations.html b/reference/data-correlations.html new file mode 100644 index 0000000..64e8ad4 --- /dev/null +++ b/reference/data-correlations.html @@ -0,0 +1,97 @@ + +Data correlations evaluation module — data-correlations • freesearcheR + Skip to contents + + +
+
+
+ +
+

Data correlations evaluation module

+
+ +
+

Usage

+
data_correlations_ui(id, ...)
+
+data_correlations_server(id, data, include.class = NULL, cutoff = 0.7, ...)
+
+ +
+

Arguments

+ + +
id
+

Module id. (Use 'ns("id")')

+ + +
...
+

arguments passed to toastui::datagrid

+ + +
data
+

data

+ + +
color.main
+

main color

+ + +
color.sec
+

secondary color

+ +
+
+

Value

+

Shiny ui module

+

shiny server module

+
+ +
+ + +
+ + + + + + + diff --git a/reference/data-summary.html b/reference/data-summary.html index 0c17fcb..5c25c37 100644 --- a/reference/data-summary.html +++ b/reference/data-summary.html @@ -42,7 +42,7 @@

Usage

data_summary_ui(id)
 
-data_summary_server(id, data, color.main, color.sec)
+data_summary_server(id, data, color.main, color.sec, ...)
@@ -50,7 +50,7 @@
id
-

id

+

Module id. (Use 'ns("id")')

data
@@ -64,6 +64,10 @@
color.sec

secondary color

+ +
...
+

arguments passed to toastui::datagrid

+

Value

diff --git a/reference/data_correlations_server.html b/reference/data_correlations_server.html new file mode 100644 index 0000000..4a17103 --- /dev/null +++ b/reference/data_correlations_server.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/reference/data_correlations_ui.html b/reference/data_correlations_ui.html new file mode 100644 index 0000000..4a17103 --- /dev/null +++ b/reference/data_correlations_ui.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/reference/get_fun_options.html b/reference/get_fun_options.html new file mode 100644 index 0000000..7a3a559 --- /dev/null +++ b/reference/get_fun_options.html @@ -0,0 +1,118 @@ + +Get the function options based on the selected function description — get_fun_options • freesearcheR + Skip to contents + + +
+
+
+ +
+

Get the function options based on the selected function description

+
+ +
+

Usage

+
get_fun_options(data)
+
+ +
+

Arguments

+ + +
data
+

vector

+ +
+
+

Value

+

list

+
+ +
+

Examples

+
mtcars |>
+  default_parsing() |>
+  dplyr::pull(mpg) |>
+  possible_functions(design = "cross-sectional") |>
+  (\(.x){
+    .x[[1]]
+  })() |>
+  get_fun_options()
+#> $lm
+#> $lm$descr
+#> [1] "Linear regression model"
+#> 
+#> $lm$design
+#> [1] "cross-sectional"
+#> 
+#> $lm$out.type
+#> [1] "continuous"
+#> 
+#> $lm$fun
+#> [1] "stats::lm"
+#> 
+#> $lm$args.list
+#> NULL
+#> 
+#> $lm$formula.str
+#> [1] "{outcome.str}~{paste(vars,collapse='+')}"
+#> 
+#> $lm$table.fun
+#> [1] "gtsummary::tbl_regression"
+#> 
+#> $lm$table.args.list
+#> $lm$table.args.list$exponentiate
+#> [1] FALSE
+#> 
+#> 
+#> 
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/getfun.html b/reference/getfun.html index c360e8a..78c3c37 100644 --- a/reference/getfun.html +++ b/reference/getfun.html @@ -131,7 +131,7 @@ #> z$qr <- NULL #> z #> } -#> <bytecode: 0x55f395fa03c8> +#> <bytecode: 0x55c682a23c78> #> <environment: namespace:stats>
diff --git a/reference/gg_theme_export.html b/reference/gg_theme_export.html new file mode 100644 index 0000000..2f1de62 --- /dev/null +++ b/reference/gg_theme_export.html @@ -0,0 +1,78 @@ + +GGplot default theme for plotting export objects — gg_theme_export • freesearcheR + Skip to contents + + +
+
+
+ +
+

GGplot default theme for plotting export objects

+
+ +
+

Usage

+
gg_theme_export()
+
+ +
+

Arguments

+ + +
data
+

ggplot object

+ +
+
+

Value

+

ggplot object

+
+ +
+ + +
+ + + + + + + diff --git a/reference/gg_theme_shiny.html b/reference/gg_theme_shiny.html new file mode 100644 index 0000000..865bd3c --- /dev/null +++ b/reference/gg_theme_shiny.html @@ -0,0 +1,78 @@ + +GGplot default theme for plotting in Shiny — gg_theme_shiny • freesearcheR + Skip to contents + + +
+
+
+ +
+

GGplot default theme for plotting in Shiny

+
+ +
+

Usage

+
gg_theme_shiny()
+
+ +
+

Arguments

+ + +
data
+

ggplot object

+ +
+
+

Value

+

ggplot object

+
+ +
+ + +
+ + + + + + + diff --git a/reference/index.html b/reference/index.html index 8a40bf9..1f45597 100644 --- a/reference/index.html +++ b/reference/index.html @@ -69,6 +69,18 @@
Print a flexible baseline characteristics table
+ clean_date() + +
+
Attempts at applying uniform date format
+
+ + clean_sep() + +
+
gsub wrapper for piping with default values for separator substituting
+
+ create_overview_datagrid()
@@ -93,6 +105,12 @@
Extended cutting function
+ data_correlations_ui() data_correlations_server() + +
+
Data correlations evaluation module
+
+ data_summary_ui() data_summary_server()
@@ -129,12 +147,30 @@
Merges list of named arguments for qmd header generation
+ get_fun_options() + +
+
Get the function options based on the selected function description
+
+ getfun()
Wrapper function to get function from character vector referring to function from namespace. Passed to 'do.call()'
+ gg_theme_export() + +
+
GGplot default theme for plotting export objects
+
+ + gg_theme_shiny() + +
+
GGplot default theme for plotting in Shiny
+
+ index_embed()
@@ -159,24 +195,54 @@
Test is date/datetime/time
+ launch() + +
+
Easily launch the freesearcheR app
+
+ m_datafileUI()
Shiny UI module to load a data file
+ merge_long() + +
+
Wrapper to pivot gtsummary table data to long for plotting
+
+ modify_qmd()
Wrapper to modify quarto file to render specific formats
+ outcome_type() + +
+
Outcome data type assessment
+
+ overview_vars()
Create a data overview data.frame ready for sparklines
+ plot(<tbl_regression>) + +
+
Regression coef plot from gtsummary. Slightly modified to pass on arguments
+
+ + possible_functions() + +
+
Get possible regression models
+
+ read_input()
@@ -189,13 +255,7 @@
Shiny module to browser and export REDCap data
- regression_model() - -
-
Create a regression model programatically
-
- - regression_model_uv() + regression_model() regression_model_uv() regression_model_list() regression_model_uv_list()
Create a regression model programatically
@@ -207,6 +267,12 @@
Create table of regression model
+ remove_empty_cols() + +
+
Removes columns with completenes below cutoff
+
+ remove_na_attr()
@@ -225,6 +291,12 @@
Specify format arguments to include in qmd header/frontmatter
+ supported_functions() + +
+
Implemented functions
+
+ tbl_merge()
diff --git a/reference/launch.html b/reference/launch.html new file mode 100644 index 0000000..53c09f4 --- /dev/null +++ b/reference/launch.html @@ -0,0 +1,78 @@ + +Easily launch the freesearcheR app — launch • freesearcheR + Skip to contents + + +
+
+
+ +
+

Easily launch the freesearcheR app

+
+ +
+

Usage

+
launch(...)
+
+ +
+

Arguments

+ + +
...
+

passed on to shiny::runApp()

+ +
+
+

Value

+

shiny app

+
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/reference/merge_long.html b/reference/merge_long.html new file mode 100644 index 0000000..084d1f4 --- /dev/null +++ b/reference/merge_long.html @@ -0,0 +1,82 @@ + +Wrapper to pivot gtsummary table data to long for plotting — merge_long • freesearcheR + Skip to contents + + +
+
+
+ +
+

Wrapper to pivot gtsummary table data to long for plotting

+
+ +
+

Usage

+
merge_long(list, model.names)
+
+ +
+

Arguments

+ + +
list
+

a custom regression models list

+ + +
model.names
+

names of models to include

+ +
+
+

Value

+

list

+
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/reference/outcome_type.html b/reference/outcome_type.html new file mode 100644 index 0000000..0599c8a --- /dev/null +++ b/reference/outcome_type.html @@ -0,0 +1,118 @@ + +Outcome data type assessment — outcome_type • freesearcheR + Skip to contents + + +
+
+
+ +
+

Outcome data type assessment

+
+ +
+

Usage

+
outcome_type(data)
+
+ +
+

Arguments

+ + +
data
+

data

+ +
+
+

Value

+

outcome type

+
+ +
+

Examples

+
mtcars |>
+  default_parsing() |>
+  lapply(outcome_type)
+#> $mpg
+#> [1] "continuous"
+#> 
+#> $cyl
+#> [1] "ordinal"
+#> 
+#> $disp
+#> [1] "continuous"
+#> 
+#> $hp
+#> [1] "continuous"
+#> 
+#> $drat
+#> [1] "continuous"
+#> 
+#> $wt
+#> [1] "continuous"
+#> 
+#> $qsec
+#> [1] "continuous"
+#> 
+#> $vs
+#> [1] "dichotomous"
+#> 
+#> $am
+#> [1] "dichotomous"
+#> 
+#> $gear
+#> [1] "ordinal"
+#> 
+#> $carb
+#> [1] "ordinal"
+#> 
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/plot.tbl_regression.html b/reference/plot.tbl_regression.html new file mode 100644 index 0000000..b09a0f5 --- /dev/null +++ b/reference/plot.tbl_regression.html @@ -0,0 +1,95 @@ + +Regression coef plot from gtsummary. Slightly modified to pass on arguments — plot.tbl_regression • freesearcheR + Skip to contents + + +
+
+
+ +
+

Regression coef plot from gtsummary. Slightly modified to pass on arguments

+
+ +
+

Usage

+
# S3 method for class 'tbl_regression'
+plot(x, ...)
+
+ +
+

Arguments

+ + +
x
+

(tbl_regression, tbl_uvregression)
+A 'tbl_regression' or 'tbl_uvregression' object

+ + +
...
+

arguments passed to ggstats::ggcoef_plot(...)

+ +
+
+

Value

+

ggplot object

+
+ +
+

Examples

+
if (FALSE) { # \dontrun{
+mod <- lm(mpg ~ ., mtcars)
+p <- mod |>
+  gtsummary::tbl_regression() |>
+  plot(colour = "variable")
+} # }
+
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/possible_functions.html b/reference/possible_functions.html new file mode 100644 index 0000000..67f4340 --- /dev/null +++ b/reference/possible_functions.html @@ -0,0 +1,93 @@ + +Get possible regression models — possible_functions • freesearcheR + Skip to contents + + +
+
+
+ +
+

Get possible regression models

+
+ +
+

Usage

+
possible_functions(data, design = c("cross-sectional"))
+
+ +
+

Arguments

+ + +
data
+

data

+ +
+
+

Value

+

character vector

+
+ +
+

Examples

+
mtcars |>
+  default_parsing() |>
+  dplyr::pull("cyl") |>
+  possible_functions(design = "cross-sectional")
+#> [1] "Ordinal logistic regression model"
+
+mtcars |>
+  default_parsing() |>
+  dplyr::select("cyl") |>
+  possible_functions(design = "cross-sectional")
+#> [1] "Ordinal logistic regression model"
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/regression_model.html b/reference/regression_model.html index d5b6086..79b8e5a 100644 --- a/reference/regression_model.html +++ b/reference/regression_model.html @@ -1,5 +1,5 @@ -Create a regression model programatically — regression_model • freesearcheR +Create a regression model programatically — regression_model • freesearcheR Skip to contents @@ -35,7 +35,7 @@
-

Create a regression model programatically

+

Output is a concatenated list of model information and model

@@ -43,12 +43,43 @@
regression_model(
   data,
   outcome.str,
-  auto.mode = TRUE,
+  auto.mode = FALSE,
   formula.str = NULL,
   args.list = NULL,
   fun = NULL,
   vars = NULL,
   ...
+)
+
+regression_model_uv(
+  data,
+  outcome.str,
+  args.list = NULL,
+  fun = NULL,
+  vars = NULL,
+  ...
+)
+
+regression_model_list(
+  data,
+  outcome.str,
+  fun.descr,
+  fun = NULL,
+  formula.str = NULL,
+  args.list = NULL,
+  vars = NULL,
+  ...
+)
+
+regression_model_uv_list(
+  data,
+  outcome.str,
+  fun.descr,
+  fun = NULL,
+  formula.str = NULL,
+  args.list = NULL,
+  vars = NULL,
+  ...
 )
@@ -57,11 +88,11 @@
data
-

data set

+

data

outcome.str
-

Name of outcome variable. Character vector.

+

name of outcome variable

auto.mode
@@ -69,15 +100,16 @@
formula.str
-

Formula as string. Passed through 'glue::glue'. If given, 'outcome.str' and 'vars' are ignored. Optional.

+

custom formula glue string. Default is NULL.

args.list
-

List of arguments passed to 'fun' with 'do.call'.

+

custom character string to be converted using +argsstring2list() or list of arguments. Default is NULL.

fun
-

Name of function as character vector or function to use for model creation.

+

name of custom function. Default is NULL.

vars
@@ -85,12 +117,20 @@
...
-

ignored for now

+

ignored

+ + +
fun.descr
+

Description of chosen function matching description in +"supported_functions()"

Value

object of standard class for fun

+

object of standard class for fun

+

list

+

list

@@ -524,12 +564,14 @@ #> gradeII gradeIII response death ttdeath #> 0.1750 1.6855 4.9885 3.0775 -0.1394 #> -gtsummary::trial |> regression_model( - outcome.str = "trt", - auto.mode = FALSE, - fun = "stats::glm", - args.list = list(family = binomial(link = "logit")) -) +gtsummary::trial |> + default_parsing() |> + regression_model( + outcome.str = "trt", + auto.mode = FALSE, + fun = "stats::glm", + args.list = list(family = binomial(link = "logit")) + ) #> #> Call: (function (formula, family = gaussian, data, weights, subset, #> na.action, start = NULL, etastart, mustart, offset, control = list(...), @@ -765,35 +807,36 @@ #> 1L, 1L, 1L, 3L, 1L, 1L, 2L, 1L, 1L, 3L, 3L, 1L, 3L, 2L, 1L, #> 3L, 1L, 2L, 1L, 1L, 3L, 1L, 2L, 1L, 2L, 2L, 2L, 3L, 2L, 2L, #> 3L, 2L, 3L, 3L, 2L, 1L, 2L, 3L, 3L, 1L), levels = c("I", -#> "II", "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1L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, +#> 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, +#> 1L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, +#> 1L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, +#> 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, +#> 1L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, +#> 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L), levels = c("0", +#> "1"), class = "factor", label = "Patient Died"), ttdeath = structure(c(24, #> 24, 24, 17.64, 16.43, 15.64, 24, 18.43, 24, 10.53, 24, 24, #> 14.34, 12.89, 22.68, 8.71, 24, 15.21, 24, 24, 24, 24, 16.92, #> 23.89, 6.32, 15.77, 24, 24, 15.45, 17.43, 24, 20.9, 24, 24, @@ -818,13 +861,80 @@ #> Coefficients: #> (Intercept) age marker stageT2 stageT3 stageT4 #> 1.652845 -0.002014 -0.259849 0.404341 0.117402 -0.002102 -#> gradeII gradeIII response death ttdeath +#> gradeII gradeIII response1 death1 ttdeath #> -0.037012 0.022890 0.498952 -0.003916 -0.076073 #> #> Degrees of Freedom: 172 Total (i.e. Null); 162 Residual #> (27 observations deleted due to missingness) #> Null Deviance: 239.5 #> Residual Deviance: 230.9 AIC: 252.9 +m <- mtcars |> + default_parsing() |> + regression_model( + outcome.str = "mpg", + auto.mode = FALSE, + fun = "stats::lm", + formula.str = "{outcome.str}~{paste(vars,collapse='+')}", + args.list = NULL, + vars = c("mpg", "cyl") + ) + broom::tidy(m) +#> # A tibble: 3 × 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 26.7 0.972 27.4 2.69e-22 +#> 2 cyl6 -6.92 1.56 -4.44 1.19e- 4 +#> 3 cyl8 -11.6 1.30 -8.90 8.57e-10 +if (FALSE) { # \dontrun{ +gtsummary::trial |> + regression_model_uv(outcome.str = "age") +gtsummary::trial |> + regression_model_uv( + outcome.str = "age", + fun = "stats::lm", + args.list = NULL + ) +m <- gtsummary::trial |> regression_model_uv( + outcome.str = "trt", + fun = "stats::glm", + args.list = list(family = stats::binomial(link = "logit")) +) +lapply(m,broom::tidy) |> dplyr::bind_rows() +} # } +if (FALSE) { # \dontrun{ +gtsummary::trial |> + regression_model( + outcome.str = "age", + fun = "stats::lm", + formula.str = "{outcome.str}~.", + args.list = NULL + ) +ls <- regression_model_list(data = default_parsing(mtcars), outcome.str = "cyl", fun.descr = "Ordinal logistic regression model") +summary(ls$model) + +ls <- regression_model_list(data = default_parsing(gtsummary::trial), outcome.str = "trt", fun.descr = "Logistic regression model") +tbl <- gtsummary::tbl_regression(ls$model, exponentiate = TRUE) +m <- gtsummary::trial |> + default_parsing() |> + regression_model( + outcome.str = "trt", + fun = "stats::glm", + formula.str = "{outcome.str}~.", + args.list = list(family = stats::binomial(link = "logit")) + ) +tbl2 <- gtsummary::tbl_regression(m, exponentiate = TRUE) +broom::tidy(ls$model) +broom::tidy(m) +} # } +if (FALSE) { # \dontrun{ +gtsummary::trial |> regression_model_uv( + outcome.str = "trt", + fun = "stats::glm", + args.list = list(family = stats::binomial(link = "logit")) +) |> lapply(broom::tidy) |> dplyr::bind_rows() +ms <- regression_model_uv_list(data = default_parsing(mtcars), outcome.str = "mpg", fun.descr = "Linear regression model") +lapply(ms$model,broom::tidy) |> dplyr::bind_rows() +} # }