docs
Some checks failed
pkgdown.yaml / pkgdown (push) Has been cancelled

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-03-24 14:43:50 +01:00
parent 16adb622ee
commit e9422a418b
No known key found for this signature in database
17 changed files with 173 additions and 48 deletions

View file

@ -9,10 +9,13 @@ export(allign_axes)
export(append_list) export(append_list)
export(argsstring2list) export(argsstring2list)
export(baseline_table) export(baseline_table)
export(clean_common_axis)
export(clean_date) export(clean_date)
export(clean_sep) export(clean_sep)
export(columnSelectInput) export(columnSelectInput)
export(contrast_text) export(contrast_text)
export(create_baseline)
export(create_log_tics)
export(create_overview_datagrid) export(create_overview_datagrid)
export(create_plot) export(create_plot)
export(custom_theme) export(custom_theme)
@ -20,8 +23,10 @@ export(cut_variable_server)
export(cut_variable_ui) export(cut_variable_ui)
export(data_correlations_server) export(data_correlations_server)
export(data_correlations_ui) export(data_correlations_ui)
export(data_description)
export(data_summary_server) export(data_summary_server)
export(data_summary_ui) export(data_summary_ui)
export(data_type)
export(data_visuals_server) export(data_visuals_server)
export(data_visuals_ui) export(data_visuals_ui)
export(default_format_arguments) export(default_format_arguments)
@ -61,8 +66,9 @@ export(missing_fraction)
export(modal_cut_variable) export(modal_cut_variable)
export(modal_update_factor) export(modal_update_factor)
export(modify_qmd) export(modify_qmd)
export(outcome_type)
export(overview_vars) export(overview_vars)
export(plot_box)
export(plot_box_single)
export(plot_euler) export(plot_euler)
export(plot_euler_single) export(plot_euler_single)
export(plot_hbars) export(plot_hbars)

View file

@ -36,7 +36,7 @@ plot_box <- function(data, x, y, z = NULL) {
#' #'
#' @name data-plots #' @name data-plots
#' #'
#' @returns #' @returns ggplot object
#' @export #' @export
#' #'
#' @examples #' @examples

View file

@ -123,7 +123,7 @@ limit_log <- function(data, fun, ...) {
#' #'
#' @param data numeric vector #' @param data numeric vector
#' #'
#' @returns #' @returns numeric vector
#' @export #' @export
#' #'
#' @examples #' @examples

View file

@ -20,8 +20,8 @@ list
Append list with named index Append list with named index
} }
\examples{ \examples{
ls_d <- list(test=c(1:20)) ls_d <- list(test = c(1:20))
ls_d <- list() ls_d <- list()
data.frame(letters[1:20],1:20) |> append_list(ls_d,"letters") data.frame(letters[1:20], 1:20) |> append_list(ls_d, "letters")
letters[1:20]|> append_list(ls_d,"letters") letters[1:20] |> append_list(ls_d, "letters")
} }

19
man/clean_common_axis.Rd Normal file
View file

@ -0,0 +1,19 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_plots.R
\name{clean_common_axis}
\alias{clean_common_axis}
\title{Extract and clean axis ranges}
\usage{
clean_common_axis(p, axis)
}
\arguments{
\item{p}{plot}
\item{axis}{axis. x or y.}
}
\value{
vector
}
\description{
Extract and clean axis ranges
}

28
man/create_baseline.Rd Normal file
View file

@ -0,0 +1,28 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/baseline_table.R
\name{create_baseline}
\alias{create_baseline}
\title{Create a baseline table}
\usage{
create_baseline(data, ..., by.var, add.p = FALSE, add.overall = FALSE)
}
\arguments{
\item{data}{data}
\item{...}{passed as fun.arg to baseline_table()}
\item{add.p}{add comparison/p-value}
\item{add.overall}{add overall column}
\item{strat.var}{grouping/strat variable}
}
\value{
gtsummary table list object
}
\description{
Create a baseline table
}
\examples{
mtcars |> create_baseline(by.var = "gear", add.p="yes"=="yes")
}

20
man/create_log_tics.Rd Normal file
View file

@ -0,0 +1,20 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/regression_plot.R
\name{create_log_tics}
\alias{create_log_tics}
\title{Create summetric log ticks}
\usage{
create_log_tics(data)
}
\arguments{
\item{data}{numeric vector}
}
\value{
numeric vector
}
\description{
Create summetric log ticks
}
\examples{
c(sample(seq(.1, 1, .1), 3), sample(1:10, 3)) |> create_log_tics()
}

View file

@ -1,11 +1,13 @@
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_plots.R, R/plot_hbar.R, R/plot_ridge.R, % Please edit documentation in R/data_plots.R, R/plot_box.R, R/plot_hbar.R,
% R/plot_sankey.R, R/plot_scatter.R, R/plot_violin.R % R/plot_ridge.R, R/plot_sankey.R, R/plot_scatter.R, R/plot_violin.R
\name{data-plots} \name{data-plots}
\alias{data-plots} \alias{data-plots}
\alias{data_visuals_ui} \alias{data_visuals_ui}
\alias{data_visuals_server} \alias{data_visuals_server}
\alias{create_plot} \alias{create_plot}
\alias{plot_box}
\alias{plot_box_single}
\alias{plot_hbars} \alias{plot_hbars}
\alias{plot_ridge} \alias{plot_ridge}
\alias{sankey_ready} \alias{sankey_ready}
@ -20,6 +22,10 @@ data_visuals_server(id, data, ...)
create_plot(data, type, x, y, z = NULL, ...) create_plot(data, type, x, y, z = NULL, ...)
plot_box(data, x, y, z = NULL)
plot_box_single(data, x, y = NULL, seed = 2103)
plot_hbars(data, x, y, z = NULL) plot_hbars(data, x, y, z = NULL)
plot_ridge(data, x, y, z = NULL, ...) plot_ridge(data, x, y, z = NULL, ...)
@ -56,6 +62,10 @@ ggplot2 object
ggplot2 object ggplot2 object
ggplot object
ggplot2 object
ggplot2 object ggplot2 object
data.frame data.frame
@ -71,6 +81,10 @@ Data correlations evaluation module
Wrapper to create plot based on provided type Wrapper to create plot based on provided type
Beautiful box plot(s)
Create nice box-plots
Nice horizontal stacked bars (Grotta bars) Nice horizontal stacked bars (Grotta bars)
Plot nice ridge plot Plot nice ridge plot
@ -85,6 +99,11 @@ Beatiful violin plot
} }
\examples{ \examples{
create_plot(mtcars, "plot_violin", "mpg", "cyl") create_plot(mtcars, "plot_violin", "mpg", "cyl")
mtcars |> plot_box(x = "mpg", y = "cyl", z = "gear")
mtcars |>
default_parsing() |>
plot_box(x = "mpg", y = "cyl", z = "gear")
mtcars |> plot_box_single("mpg","cyl")
mtcars |> plot_hbars(x = "carb", y = "cyl") mtcars |> plot_hbars(x = "carb", y = "cyl")
mtcars |> plot_hbars(x = "carb", y = NULL) mtcars |> plot_hbars(x = "carb", y = NULL)
mtcars |> mtcars |>

23
man/data_description.Rd Normal file
View file

@ -0,0 +1,23 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
\name{data_description}
\alias{data_description}
\title{Ultra short data dascription}
\usage{
data_description(data)
}
\arguments{
\item{data}{}
}
\value{
character vector
}
\description{
Ultra short data dascription
}
\examples{
data.frame(
sample(1:8, 20, TRUE),
sample(c(1:8, NA), 20, TRUE)
) |> data_description()
}

27
man/data_type.Rd Normal file
View file

@ -0,0 +1,27 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/regression_model.R
\name{data_type}
\alias{data_type}
\title{Data type assessment}
\usage{
data_type(data)
}
\arguments{
\item{data}{data}
}
\value{
outcome type
}
\description{
Data type assessment
}
\examples{
mtcars |>
default_parsing() |>
lapply(data_type)
c(1, 2) |> data_type()
1 |> data_type()
c(rep(NA, 10)) |> data_type()
sample(1:100, 50) |> data_type()
factor(letters[1:20]) |> data_type()
}

View file

@ -20,8 +20,8 @@ numeric vector
Easily round log scale limits for nice plots Easily round log scale limits for nice plots
} }
\examples{ \examples{
limit_log(-.1,floor) limit_log(-.1, floor)
limit_log(.1,ceiling) limit_log(.1, ceiling)
limit_log(-2.1,ceiling) limit_log(-2.1, ceiling)
limit_log(2.1,ceiling) limit_log(2.1, ceiling)
} }

View file

@ -16,5 +16,5 @@ numeric vector
Get missingsness fraction Get missingsness fraction
} }
\examples{ \examples{
c(NA,1:10,rep(NA,3)) |> missing_fraction() c(NA, 1:10, rep(NA, 3)) |> missing_fraction()
} }

View file

@ -1,22 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/regression_model.R
\name{outcome_type}
\alias{outcome_type}
\title{Outcome data type assessment}
\usage{
outcome_type(data)
}
\arguments{
\item{data}{data}
}
\value{
outcome type
}
\description{
Outcome data type assessment
}
\examples{
mtcars |>
default_parsing() |>
lapply(outcome_type)
}

View file

@ -111,7 +111,7 @@ m <- mtcars |>
args.list = NULL, args.list = NULL,
vars = c("mpg", "cyl") vars = c("mpg", "cyl")
) )
broom::tidy(m) broom::tidy(m)
\dontrun{ \dontrun{
gtsummary::trial |> gtsummary::trial |>
regression_model_uv(outcome.str = "age") regression_model_uv(outcome.str = "age")
@ -126,7 +126,7 @@ m <- gtsummary::trial |> regression_model_uv(
fun = "stats::glm", fun = "stats::glm",
args.list = list(family = stats::binomial(link = "logit")) args.list = list(family = stats::binomial(link = "logit"))
) )
lapply(m,broom::tidy) |> dplyr::bind_rows() lapply(m, broom::tidy) |> dplyr::bind_rows()
} }
\dontrun{ \dontrun{
gtsummary::trial |> gtsummary::trial |>
@ -154,12 +154,15 @@ broom::tidy(ls$model)
broom::tidy(m) broom::tidy(m)
} }
\dontrun{ \dontrun{
gtsummary::trial |> regression_model_uv( gtsummary::trial |>
regression_model_uv(
outcome.str = "trt", outcome.str = "trt",
fun = "stats::glm", fun = "stats::glm",
args.list = list(family = stats::binomial(link = "logit")) args.list = list(family = stats::binomial(link = "logit"))
) |> lapply(broom::tidy) |> dplyr::bind_rows() ) |>
lapply(broom::tidy) |>
dplyr::bind_rows()
ms <- regression_model_uv_list(data = default_parsing(mtcars), outcome.str = "mpg", fun.descr = "Linear regression model") 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() lapply(ms$model, broom::tidy) |> dplyr::bind_rows()
} }
} }

View file

@ -18,5 +18,5 @@ data frame
Removes columns with completenes below cutoff Removes columns with completenes below cutoff
} }
\examples{ \examples{
data.frame(a=1:10,b=NA, c=c(2,NA)) |> remove_empty_cols(cutoff=.5) data.frame(a = 1:10, b = NA, c = c(2, NA)) |> remove_empty_cols(cutoff = .5)
} }

View file

@ -16,6 +16,8 @@ data.frame
Remove NA labels Remove NA labels
} }
\examples{ \examples{
ds <- mtcars |> lapply(\(.x) REDCapCAST::set_attr(.x,label=NA,attr = "label")) ds <- mtcars |> lapply(\(.x) REDCapCAST::set_attr(.x, label = NA, attr = "label"))
ds |> remove_na_attr() |> str() ds |>
remove_na_attr() |>
str()
} }

View file

@ -4,7 +4,7 @@
\alias{subset_types} \alias{subset_types}
\title{Easily subset by data type function} \title{Easily subset by data type function}
\usage{ \usage{
subset_types(data, types, type.fun = outcome_type) subset_types(data, types, type.fun = data_type)
} }
\arguments{ \arguments{
\item{data}{data} \item{data}{data}
@ -21,6 +21,6 @@ Easily subset by data type function
} }
\examples{ \examples{
default_parsing(mtcars) |> subset_types("ordinal") default_parsing(mtcars) |> subset_types("ordinal")
default_parsing(mtcars) |> subset_types(c("dichotomous", "ordinal")) default_parsing(mtcars) |> subset_types(c("dichotomous", "ordinal" ,"categorical"))
#' default_parsing(mtcars) |> subset_types("factor",class) #' default_parsing(mtcars) |> subset_types("factor",class)
} }