mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-09-12 09:59:39 +02:00
Compare commits
3 commits
2a39655e96
...
6db500d13a
Author | SHA1 | Date | |
---|---|---|---|
6db500d13a | |||
a82a5c6378 | |||
a4ff749824 |
7 changed files with 72 additions and 10 deletions
|
@ -100,6 +100,7 @@ export(regression_model_list)
|
||||||
export(regression_model_uv)
|
export(regression_model_uv)
|
||||||
export(regression_model_uv_list)
|
export(regression_model_uv_list)
|
||||||
export(regression_table)
|
export(regression_table)
|
||||||
|
export(regression_table_create)
|
||||||
export(remove_empty_attr)
|
export(remove_empty_attr)
|
||||||
export(remove_empty_cols)
|
export(remove_empty_cols)
|
||||||
export(remove_nested_list)
|
export(remove_nested_list)
|
||||||
|
|
4
NEWS.md
4
NEWS.md
|
@ -1,3 +1,7 @@
|
||||||
|
# FreesearchR 25.5.5
|
||||||
|
|
||||||
|
- *FIX* several minor bugs and polish
|
||||||
|
|
||||||
# FreesearchR 25.5.4
|
# FreesearchR 25.5.4
|
||||||
|
|
||||||
- *FIX* correctly omit NAs in `data_type()` call
|
- *FIX* correctly omit NAs in `data_type()` call
|
||||||
|
|
|
@ -35,7 +35,7 @@ data_import_ui <- function(id) {
|
||||||
),
|
),
|
||||||
shiny::conditionalPanel(
|
shiny::conditionalPanel(
|
||||||
condition = "input.source=='env'",
|
condition = "input.source=='env'",
|
||||||
import_globalenv_ui(id = ns("env"), title = NULL)
|
datamods::import_globalenv_ui(id = ns("env"), title = NULL)
|
||||||
),
|
),
|
||||||
shiny::conditionalPanel(
|
shiny::conditionalPanel(
|
||||||
condition = "input.source=='redcap'",
|
condition = "input.source=='redcap'",
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
hosted_version <- function()'v25.5.4-250510'
|
hosted_version <- function()'v25.5.4-250512'
|
||||||
|
|
|
@ -96,18 +96,31 @@
|
||||||
#' # gtsummary::bold_p()
|
#' # gtsummary::bold_p()
|
||||||
#' }
|
#' }
|
||||||
regression_table <- function(x, ...) {
|
regression_table <- function(x, ...) {
|
||||||
|
args <- list(...)
|
||||||
|
|
||||||
if ("list" %in% class(x)) {
|
if ("list" %in% class(x)) {
|
||||||
x |>
|
x |>
|
||||||
purrr::map(\(.m){
|
purrr::map(\(.m){
|
||||||
regression_table_create(x = .m, ...) |>
|
regression_table_create(x = .m, args.list = args) |>
|
||||||
gtsummary::add_n()
|
gtsummary::add_n()
|
||||||
}) |>
|
}) |>
|
||||||
gtsummary::tbl_stack()
|
gtsummary::tbl_stack()
|
||||||
} else {
|
} else {
|
||||||
regression_table_create(x, ...)
|
regression_table_create(x, args.list = args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#' Create regression summary table
|
||||||
|
#'
|
||||||
|
#' @param x (list of) regression model
|
||||||
|
#' @param ... ignored for now
|
||||||
|
#' @param args.list args.list for the summary function
|
||||||
|
#' @param fun table summary function. Default is "gtsummary::tbl_regression"
|
||||||
|
#' @param theme summary table theme
|
||||||
|
#'
|
||||||
|
#' @returns gtsummary list object
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
regression_table_create <- function(x, ..., args.list = NULL, fun = "gtsummary::tbl_regression", theme = c("jama", "lancet", "nejm", "qjecon")) {
|
regression_table_create <- function(x, ..., args.list = NULL, fun = "gtsummary::tbl_regression", theme = c("jama", "lancet", "nejm", "qjecon")) {
|
||||||
# Stripping custom class
|
# Stripping custom class
|
||||||
class(x) <- class(x)[class(x) != "freesearchr_model"]
|
class(x) <- class(x)[class(x) != "freesearchr_model"]
|
||||||
|
|
|
@ -26,7 +26,7 @@ library(shiny)
|
||||||
# library(DHARMa)
|
# library(DHARMa)
|
||||||
# library(apexcharter)
|
# library(apexcharter)
|
||||||
library(toastui)
|
library(toastui)
|
||||||
# library(datamods)
|
library(datamods)
|
||||||
# library(IDEAFilter)
|
# library(IDEAFilter)
|
||||||
library(shinyWidgets)
|
library(shinyWidgets)
|
||||||
# library(DT)
|
# library(DT)
|
||||||
|
@ -49,7 +49,7 @@ library(rlang)
|
||||||
#### Current file: /Users/au301842/FreesearchR/R//app_version.R
|
#### Current file: /Users/au301842/FreesearchR/R//app_version.R
|
||||||
########
|
########
|
||||||
|
|
||||||
app_version <- function()'25.5.3'
|
app_version <- function()'25.5.4'
|
||||||
|
|
||||||
|
|
||||||
########
|
########
|
||||||
|
@ -2455,7 +2455,7 @@ data_import_ui <- function(id) {
|
||||||
),
|
),
|
||||||
shiny::conditionalPanel(
|
shiny::conditionalPanel(
|
||||||
condition = "input.source=='env'",
|
condition = "input.source=='env'",
|
||||||
import_globalenv_ui(id = ns("env"), title = NULL)
|
datamods::import_globalenv_ui(id = ns("env"), title = NULL)
|
||||||
),
|
),
|
||||||
shiny::conditionalPanel(
|
shiny::conditionalPanel(
|
||||||
condition = "input.source=='redcap'",
|
condition = "input.source=='redcap'",
|
||||||
|
@ -3996,7 +3996,7 @@ simple_snake <- function(data){
|
||||||
#### Current file: /Users/au301842/FreesearchR/R//hosted_version.R
|
#### Current file: /Users/au301842/FreesearchR/R//hosted_version.R
|
||||||
########
|
########
|
||||||
|
|
||||||
hosted_version <- function()'v25.5.3-250510'
|
hosted_version <- function()'v25.5.4-250512'
|
||||||
|
|
||||||
|
|
||||||
########
|
########
|
||||||
|
@ -7090,18 +7090,31 @@ symmetrical_scale_x_log10 <- function(plot, breaks = c(1, 2, 3, 5, 10), ...) {
|
||||||
#' # gtsummary::bold_p()
|
#' # gtsummary::bold_p()
|
||||||
#' }
|
#' }
|
||||||
regression_table <- function(x, ...) {
|
regression_table <- function(x, ...) {
|
||||||
|
args <- list(...)
|
||||||
|
|
||||||
if ("list" %in% class(x)) {
|
if ("list" %in% class(x)) {
|
||||||
x |>
|
x |>
|
||||||
purrr::map(\(.m){
|
purrr::map(\(.m){
|
||||||
regression_table_create(x = .m, ...) |>
|
regression_table_create(x = .m, args.list = args) |>
|
||||||
gtsummary::add_n()
|
gtsummary::add_n()
|
||||||
}) |>
|
}) |>
|
||||||
gtsummary::tbl_stack()
|
gtsummary::tbl_stack()
|
||||||
} else {
|
} else {
|
||||||
regression_table_create(x, ...)
|
regression_table_create(x, args.list = args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#' Create regression summary table
|
||||||
|
#'
|
||||||
|
#' @param x (list of) regression model
|
||||||
|
#' @param ... ignored for now
|
||||||
|
#' @param args.list args.list for the summary function
|
||||||
|
#' @param fun table summary function. Default is "gtsummary::tbl_regression"
|
||||||
|
#' @param theme summary table theme
|
||||||
|
#'
|
||||||
|
#' @returns gtsummary list object
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
regression_table_create <- function(x, ..., args.list = NULL, fun = "gtsummary::tbl_regression", theme = c("jama", "lancet", "nejm", "qjecon")) {
|
regression_table_create <- function(x, ..., args.list = NULL, fun = "gtsummary::tbl_regression", theme = c("jama", "lancet", "nejm", "qjecon")) {
|
||||||
# Stripping custom class
|
# Stripping custom class
|
||||||
class(x) <- class(x)[class(x) != "freesearchr_model"]
|
class(x) <- class(x)[class(x) != "freesearchr_model"]
|
||||||
|
|
31
man/regression_table_create.Rd
Normal file
31
man/regression_table_create.Rd
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/regression_table.R
|
||||||
|
\name{regression_table_create}
|
||||||
|
\alias{regression_table_create}
|
||||||
|
\title{Create regression summary table}
|
||||||
|
\usage{
|
||||||
|
regression_table_create(
|
||||||
|
x,
|
||||||
|
...,
|
||||||
|
args.list = NULL,
|
||||||
|
fun = "gtsummary::tbl_regression",
|
||||||
|
theme = c("jama", "lancet", "nejm", "qjecon")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
\arguments{
|
||||||
|
\item{x}{(list of) regression model}
|
||||||
|
|
||||||
|
\item{...}{ignored for now}
|
||||||
|
|
||||||
|
\item{args.list}{args.list for the summary function}
|
||||||
|
|
||||||
|
\item{fun}{table summary function. Default is "gtsummary::tbl_regression"}
|
||||||
|
|
||||||
|
\item{theme}{summary table theme}
|
||||||
|
}
|
||||||
|
\value{
|
||||||
|
gtsummary list object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Create regression summary table
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue