mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-09-12 09:59:39 +02:00
This commit is contained in:
parent
16adb622ee
commit
e9422a418b
17 changed files with 173 additions and 48 deletions
|
@ -9,10 +9,13 @@ export(allign_axes)
|
|||
export(append_list)
|
||||
export(argsstring2list)
|
||||
export(baseline_table)
|
||||
export(clean_common_axis)
|
||||
export(clean_date)
|
||||
export(clean_sep)
|
||||
export(columnSelectInput)
|
||||
export(contrast_text)
|
||||
export(create_baseline)
|
||||
export(create_log_tics)
|
||||
export(create_overview_datagrid)
|
||||
export(create_plot)
|
||||
export(custom_theme)
|
||||
|
@ -20,8 +23,10 @@ export(cut_variable_server)
|
|||
export(cut_variable_ui)
|
||||
export(data_correlations_server)
|
||||
export(data_correlations_ui)
|
||||
export(data_description)
|
||||
export(data_summary_server)
|
||||
export(data_summary_ui)
|
||||
export(data_type)
|
||||
export(data_visuals_server)
|
||||
export(data_visuals_ui)
|
||||
export(default_format_arguments)
|
||||
|
@ -61,8 +66,9 @@ export(missing_fraction)
|
|||
export(modal_cut_variable)
|
||||
export(modal_update_factor)
|
||||
export(modify_qmd)
|
||||
export(outcome_type)
|
||||
export(overview_vars)
|
||||
export(plot_box)
|
||||
export(plot_box_single)
|
||||
export(plot_euler)
|
||||
export(plot_euler_single)
|
||||
export(plot_hbars)
|
||||
|
|
|
@ -36,7 +36,7 @@ plot_box <- function(data, x, y, z = NULL) {
|
|||
#'
|
||||
#' @name data-plots
|
||||
#'
|
||||
#' @returns
|
||||
#' @returns ggplot object
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
|
|
|
@ -123,7 +123,7 @@ limit_log <- function(data, fun, ...) {
|
|||
#'
|
||||
#' @param data numeric vector
|
||||
#'
|
||||
#' @returns
|
||||
#' @returns numeric vector
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
|
|
19
man/clean_common_axis.Rd
Normal file
19
man/clean_common_axis.Rd
Normal 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
28
man/create_baseline.Rd
Normal 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
20
man/create_log_tics.Rd
Normal 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()
|
||||
}
|
|
@ -1,11 +1,13 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data_plots.R, R/plot_hbar.R, R/plot_ridge.R,
|
||||
% R/plot_sankey.R, R/plot_scatter.R, R/plot_violin.R
|
||||
% Please edit documentation in R/data_plots.R, R/plot_box.R, R/plot_hbar.R,
|
||||
% R/plot_ridge.R, R/plot_sankey.R, R/plot_scatter.R, R/plot_violin.R
|
||||
\name{data-plots}
|
||||
\alias{data-plots}
|
||||
\alias{data_visuals_ui}
|
||||
\alias{data_visuals_server}
|
||||
\alias{create_plot}
|
||||
\alias{plot_box}
|
||||
\alias{plot_box_single}
|
||||
\alias{plot_hbars}
|
||||
\alias{plot_ridge}
|
||||
\alias{sankey_ready}
|
||||
|
@ -20,6 +22,10 @@ data_visuals_server(id, data, ...)
|
|||
|
||||
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_ridge(data, x, y, z = NULL, ...)
|
||||
|
@ -56,6 +62,10 @@ ggplot2 object
|
|||
|
||||
ggplot2 object
|
||||
|
||||
ggplot object
|
||||
|
||||
ggplot2 object
|
||||
|
||||
ggplot2 object
|
||||
|
||||
data.frame
|
||||
|
@ -71,6 +81,10 @@ Data correlations evaluation module
|
|||
|
||||
Wrapper to create plot based on provided type
|
||||
|
||||
Beautiful box plot(s)
|
||||
|
||||
Create nice box-plots
|
||||
|
||||
Nice horizontal stacked bars (Grotta bars)
|
||||
|
||||
Plot nice ridge plot
|
||||
|
@ -85,6 +99,11 @@ Beatiful violin plot
|
|||
}
|
||||
\examples{
|
||||
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 = NULL)
|
||||
mtcars |>
|
||||
|
|
23
man/data_description.Rd
Normal file
23
man/data_description.Rd
Normal 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
27
man/data_type.Rd
Normal 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()
|
||||
}
|
|
@ -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)
|
||||
}
|
|
@ -154,11 +154,14 @@ broom::tidy(ls$model)
|
|||
broom::tidy(m)
|
||||
}
|
||||
\dontrun{
|
||||
gtsummary::trial |> regression_model_uv(
|
||||
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()
|
||||
) |>
|
||||
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()
|
||||
}
|
||||
|
|
|
@ -17,5 +17,7 @@ Remove NA labels
|
|||
}
|
||||
\examples{
|
||||
ds <- mtcars |> lapply(\(.x) REDCapCAST::set_attr(.x, label = NA, attr = "label"))
|
||||
ds |> remove_na_attr() |> str()
|
||||
ds |>
|
||||
remove_na_attr() |>
|
||||
str()
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
\alias{subset_types}
|
||||
\title{Easily subset by data type function}
|
||||
\usage{
|
||||
subset_types(data, types, type.fun = outcome_type)
|
||||
subset_types(data, types, type.fun = data_type)
|
||||
}
|
||||
\arguments{
|
||||
\item{data}{data}
|
||||
|
@ -21,6 +21,6 @@ Easily subset by data type function
|
|||
}
|
||||
\examples{
|
||||
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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue