mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-09-12 01:49:39 +02:00
decumented package
This commit is contained in:
parent
2588cf2b4f
commit
49695a5f41
13 changed files with 284 additions and 3 deletions
15
NAMESPACE
15
NAMESPACE
|
@ -1,11 +1,16 @@
|
|||
# Generated by roxygen2: do not edit by hand
|
||||
|
||||
S3method(cut,hms)
|
||||
export(add_class_icon)
|
||||
export(add_sparkline)
|
||||
export(argsstring2list)
|
||||
export(baseline_table)
|
||||
export(create_overview_datagrid)
|
||||
export(custom_theme)
|
||||
export(cut_variable_server)
|
||||
export(cut_variable_ui)
|
||||
export(data_summary_server)
|
||||
export(data_summary_ui)
|
||||
export(default_format_arguments)
|
||||
export(default_parsing)
|
||||
export(factorize)
|
||||
|
@ -14,21 +19,29 @@ export(format_writer)
|
|||
export(getfun)
|
||||
export(index_embed)
|
||||
export(is_any_class)
|
||||
export(is_consecutive)
|
||||
export(is_datetime)
|
||||
export(m_datafileUI)
|
||||
export(m_redcap_readServer)
|
||||
export(m_redcap_readUI)
|
||||
export(modal_cut_variable)
|
||||
export(modify_qmd)
|
||||
export(overview_vars)
|
||||
export(read_input)
|
||||
export(regression_model)
|
||||
export(regression_model_uv)
|
||||
export(regression_table)
|
||||
export(remove_na_attr)
|
||||
export(shiny_freesearcheR)
|
||||
export(specify_qmd_format)
|
||||
export(tbl_merge)
|
||||
export(update_variables_server)
|
||||
export(update_variables_ui)
|
||||
export(winbox_cut_variable)
|
||||
export(write_quarto)
|
||||
importFrom(classInt,classIntervals)
|
||||
importFrom(data.table,as.data.table)
|
||||
importFrom(data.table,data.table)
|
||||
importFrom(graphics,abline)
|
||||
importFrom(graphics,axis)
|
||||
importFrom(graphics,hist)
|
||||
|
@ -40,6 +53,7 @@ importFrom(rlang,"%||%")
|
|||
importFrom(rlang,call2)
|
||||
importFrom(rlang,expr)
|
||||
importFrom(rlang,set_names)
|
||||
importFrom(rlang,sym)
|
||||
importFrom(rlang,syms)
|
||||
importFrom(shiny,NS)
|
||||
importFrom(shiny,bindEvent)
|
||||
|
@ -68,3 +82,4 @@ importFrom(toastui,datagrid)
|
|||
importFrom(toastui,datagridOutput2)
|
||||
importFrom(toastui,grid_colorbar)
|
||||
importFrom(toastui,renderDatagrid2)
|
||||
importFrom(utils,type.convert)
|
||||
|
|
|
@ -126,7 +126,7 @@ add_sparkline <- function(grid, column = "vals", color.main = "#2a8484", color.s
|
|||
#'
|
||||
#' @param data vector
|
||||
#'
|
||||
#' @returns
|
||||
#' @returns logical
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
|
@ -233,6 +233,10 @@ create_overview_datagrid <- function(data) {
|
|||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' mtcars |>
|
||||
#' overview_vars() |>
|
||||
#' toastui::datagrid() |>
|
||||
#' add_class_icon()
|
||||
add_class_icon <- function(grid, column = "class") {
|
||||
out <- toastui::grid_format(
|
||||
grid = grid,
|
||||
|
|
|
@ -386,8 +386,14 @@ add_var_toset <- function(data, var_name, default = "") {
|
|||
data[, datanames]
|
||||
}
|
||||
|
||||
#' @importFrom toastui datagrid grid_columns grid_format grid_style_column
|
||||
#' grid_style_column grid_editor grid_editor_opts grid_selection_row
|
||||
#' Modified from the datamods pacakge
|
||||
#'
|
||||
#' @param data data
|
||||
#'
|
||||
#' @param height height
|
||||
#' @param selectionId selectionId
|
||||
#' @param buttonId buttonId
|
||||
#'
|
||||
#' @examples
|
||||
#' mtcars |>
|
||||
#' summary_vars() |>
|
||||
|
|
25
man/add_class_icon.Rd
Normal file
25
man/add_class_icon.Rd
Normal 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
32
man/add_sparkline.Rd
Normal 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
|
||||
}
|
22
man/create_overview_datagrid.Rd
Normal file
22
man/create_overview_datagrid.Rd
Normal 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
29
man/data-summary.Rd
Normal 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
21
man/is_consecutive.Rd
Normal 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
17
man/m_datafileUI.Rd
Normal 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
20
man/overview_vars.Rd
Normal 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
21
man/remove_na_attr.Rd
Normal 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
38
man/update-variables.Rd
Normal 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
|
||||
}
|
31
man/update_variables_datagrid.Rd
Normal file
31
man/update_variables_datagrid.Rd
Normal 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()
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue