decumented package

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-01-16 11:45:04 +01:00
parent 2588cf2b4f
commit 49695a5f41
No known key found for this signature in database
13 changed files with 284 additions and 3 deletions

View file

@ -1,11 +1,16 @@
# Generated by roxygen2: do not edit by hand # Generated by roxygen2: do not edit by hand
S3method(cut,hms) S3method(cut,hms)
export(add_class_icon)
export(add_sparkline)
export(argsstring2list) export(argsstring2list)
export(baseline_table) export(baseline_table)
export(create_overview_datagrid)
export(custom_theme) export(custom_theme)
export(cut_variable_server) export(cut_variable_server)
export(cut_variable_ui) export(cut_variable_ui)
export(data_summary_server)
export(data_summary_ui)
export(default_format_arguments) export(default_format_arguments)
export(default_parsing) export(default_parsing)
export(factorize) export(factorize)
@ -14,21 +19,29 @@ export(format_writer)
export(getfun) export(getfun)
export(index_embed) export(index_embed)
export(is_any_class) export(is_any_class)
export(is_consecutive)
export(is_datetime) export(is_datetime)
export(m_datafileUI)
export(m_redcap_readServer) export(m_redcap_readServer)
export(m_redcap_readUI) export(m_redcap_readUI)
export(modal_cut_variable) export(modal_cut_variable)
export(modify_qmd) export(modify_qmd)
export(overview_vars)
export(read_input) export(read_input)
export(regression_model) export(regression_model)
export(regression_model_uv) export(regression_model_uv)
export(regression_table) export(regression_table)
export(remove_na_attr)
export(shiny_freesearcheR) export(shiny_freesearcheR)
export(specify_qmd_format) export(specify_qmd_format)
export(tbl_merge) export(tbl_merge)
export(update_variables_server)
export(update_variables_ui)
export(winbox_cut_variable) export(winbox_cut_variable)
export(write_quarto) export(write_quarto)
importFrom(classInt,classIntervals) importFrom(classInt,classIntervals)
importFrom(data.table,as.data.table)
importFrom(data.table,data.table)
importFrom(graphics,abline) importFrom(graphics,abline)
importFrom(graphics,axis) importFrom(graphics,axis)
importFrom(graphics,hist) importFrom(graphics,hist)
@ -40,6 +53,7 @@ importFrom(rlang,"%||%")
importFrom(rlang,call2) importFrom(rlang,call2)
importFrom(rlang,expr) importFrom(rlang,expr)
importFrom(rlang,set_names) importFrom(rlang,set_names)
importFrom(rlang,sym)
importFrom(rlang,syms) importFrom(rlang,syms)
importFrom(shiny,NS) importFrom(shiny,NS)
importFrom(shiny,bindEvent) importFrom(shiny,bindEvent)
@ -68,3 +82,4 @@ importFrom(toastui,datagrid)
importFrom(toastui,datagridOutput2) importFrom(toastui,datagridOutput2)
importFrom(toastui,grid_colorbar) importFrom(toastui,grid_colorbar)
importFrom(toastui,renderDatagrid2) importFrom(toastui,renderDatagrid2)
importFrom(utils,type.convert)

View file

@ -126,7 +126,7 @@ add_sparkline <- function(grid, column = "vals", color.main = "#2a8484", color.s
#' #'
#' @param data vector #' @param data vector
#' #'
#' @returns #' @returns logical
#' @export #' @export
#' #'
#' @examples #' @examples
@ -233,6 +233,10 @@ create_overview_datagrid <- function(data) {
#' @export #' @export
#' #'
#' @examples #' @examples
#' mtcars |>
#' overview_vars() |>
#' toastui::datagrid() |>
#' add_class_icon()
add_class_icon <- function(grid, column = "class") { add_class_icon <- function(grid, column = "class") {
out <- toastui::grid_format( out <- toastui::grid_format(
grid = grid, grid = grid,

View file

@ -386,8 +386,14 @@ add_var_toset <- function(data, var_name, default = "") {
data[, datanames] data[, datanames]
} }
#' @importFrom toastui datagrid grid_columns grid_format grid_style_column #' Modified from the datamods pacakge
#' grid_style_column grid_editor grid_editor_opts grid_selection_row #'
#' @param data data
#'
#' @param height height
#' @param selectionId selectionId
#' @param buttonId buttonId
#'
#' @examples #' @examples
#' mtcars |> #' mtcars |>
#' summary_vars() |> #' summary_vars() |>

25
man/add_class_icon.Rd Normal file
View file

@ -0,0 +1,25 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-summary.R
\name{add_class_icon}
\alias{add_class_icon}
\title{Convert class grid column to icon}
\usage{
add_class_icon(grid, column = "class")
}
\arguments{
\item{grid}{grid}
\item{column}{column}
}
\value{
datagrid
}
\description{
Convert class grid column to icon
}
\examples{
mtcars |>
overview_vars() |>
toastui::datagrid() |>
add_class_icon()
}

32
man/add_sparkline.Rd Normal file
View file

@ -0,0 +1,32 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-summary.R
\name{add_sparkline}
\alias{add_sparkline}
\title{Add sparkline to datagrid}
\usage{
add_sparkline(
grid,
column = "vals",
color.main = "#2a8484",
color.sec = "#84EF84"
)
}
\arguments{
\item{grid}{grid}
\item{column}{clumn to transform}
}
\value{
datagrid
}
\description{
Add sparkline to datagrid
}
\examples{
grid <- mtcars |>
default_parsing() |>
overview_vars() |>
toastui::datagrid() |>
add_sparkline()
grid
}

View file

@ -0,0 +1,22 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-summary.R
\name{create_overview_datagrid}
\alias{create_overview_datagrid}
\title{Create a data overview datagrid}
\usage{
create_overview_datagrid(data)
}
\arguments{
\item{data}{data}
}
\value{
datagrid
}
\description{
Create a data overview datagrid
}
\examples{
mtcars |>
overview_vars() |>
create_overview_datagrid()
}

29
man/data-summary.Rd Normal file
View file

@ -0,0 +1,29 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-summary.R
\name{data-summary}
\alias{data-summary}
\alias{data_summary_ui}
\alias{data_summary_server}
\title{Data summary module}
\usage{
data_summary_ui(id)
data_summary_server(id, data, color.main, color.sec)
}
\arguments{
\item{id}{id}
\item{data}{data}
\item{color.main}{main color}
\item{color.sec}{secondary color}
}
\value{
Shiny ui module
shiny server module
}
\description{
Data summary module
}

21
man/is_consecutive.Rd Normal file
View file

@ -0,0 +1,21 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-summary.R
\name{is_consecutive}
\alias{is_consecutive}
\title{Checks if elements in vector are equally spaced as indication of ID}
\usage{
is_consecutive(data)
}
\arguments{
\item{data}{vector}
}
\value{
logical
}
\description{
Checks if elements in vector are equally spaced as indication of ID
}
\examples{
1:10 |> is_consecutive()
sample(1:100,40) |> is_consecutive()
}

17
man/m_datafileUI.Rd Normal file
View file

@ -0,0 +1,17 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/file-import-module.R
\name{m_datafileUI}
\alias{m_datafileUI}
\title{Shiny UI module to load a data file}
\usage{
m_datafileUI(id)
}
\arguments{
\item{id}{id}
}
\value{
shiny UI
}
\description{
Shiny UI module to load a data file
}

20
man/overview_vars.Rd Normal file
View file

@ -0,0 +1,20 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-summary.R
\name{overview_vars}
\alias{overview_vars}
\title{Create a data overview data.frame ready for sparklines}
\usage{
overview_vars(data)
}
\arguments{
\item{data}{data}
}
\value{
data.frame
}
\description{
Create a data overview data.frame ready for sparklines
}
\examples{
mtcars |> overview_vars()
}

21
man/remove_na_attr.Rd Normal file
View file

@ -0,0 +1,21 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
\name{remove_na_attr}
\alias{remove_na_attr}
\title{Remove NA labels}
\usage{
remove_na_attr(data, attr = "label")
}
\arguments{
\item{data}{data}
}
\value{
data.frame
}
\description{
Remove NA labels
}
\examples{
ds <- mtcars |> lapply(\(.x) REDCapCAST::set_attr(.x,label=NA,attr = "label"))
ds |> remove_na_attr() |> str()
}

38
man/update-variables.Rd Normal file
View file

@ -0,0 +1,38 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/update-variables-ext.R
\name{update-variables}
\alias{update-variables}
\alias{update_variables_ui}
\alias{update_variables_server}
\title{Select, rename and convert variables}
\usage{
update_variables_ui(id, title = TRUE)
update_variables_server(
id,
data,
height = NULL,
return_data_on_init = FALSE,
try_silent = FALSE
)
}
\arguments{
\item{id}{Module's ID}
\item{title}{Module's title, if \code{TRUE} use the default title,
use \code{NULL} for no title or a \code{shiny.tag} for a custom one.}
\item{data}{a \code{data.frame} or a \code{reactive} function returning a \code{data.frame}.}
\item{height}{Height for the table.}
\item{return_data_on_init}{Return initial data when module is called.}
\item{try_silent}{logical: should the report of error messages be suppressed?}
}
\value{
A \code{\link[shiny:reactive]{shiny::reactive()}} function returning the updated data.
}
\description{
Select, rename and convert variables
}

View file

@ -0,0 +1,31 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/update-variables-ext.R
\name{update_variables_datagrid}
\alias{update_variables_datagrid}
\title{Modified from the datamods pacakge}
\usage{
update_variables_datagrid(
data,
height = NULL,
selectionId = NULL,
buttonId = NULL
)
}
\arguments{
\item{data}{data}
\item{height}{height}
\item{selectionId}{selectionId}
\item{buttonId}{buttonId}
}
\description{
Modified from the datamods pacakge
}
\examples{
mtcars |>
summary_vars() |>
update_variables_datagrid()
}