mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-09-12 09:59:39 +02:00
moving towards first working state
This commit is contained in:
parent
05b37b76b3
commit
4c0a19f09f
14 changed files with 75 additions and 1695 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ dev/
|
||||||
.httr-oauth
|
.httr-oauth
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.quarto
|
.quarto
|
||||||
|
app/rsconnect
|
||||||
|
|
|
@ -11,6 +11,7 @@ Roxygen: list(markdown = TRUE)
|
||||||
RoxygenNote: 7.3.2
|
RoxygenNote: 7.3.2
|
||||||
Imports:
|
Imports:
|
||||||
assertthat,
|
assertthat,
|
||||||
|
bslib,
|
||||||
dplyr,
|
dplyr,
|
||||||
glue,
|
glue,
|
||||||
gt,
|
gt,
|
||||||
|
@ -20,7 +21,8 @@ Imports:
|
||||||
openxlsx2,
|
openxlsx2,
|
||||||
quarto,
|
quarto,
|
||||||
readODS,
|
readODS,
|
||||||
readr
|
readr,
|
||||||
|
shiny
|
||||||
Suggests:
|
Suggests:
|
||||||
MASS,
|
MASS,
|
||||||
styler
|
styler
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# Generated by roxygen2: do not edit by hand
|
# Generated by roxygen2: do not edit by hand
|
||||||
|
|
||||||
|
export(argsstring2list)
|
||||||
export(baseline_table)
|
export(baseline_table)
|
||||||
export(file_extension)
|
export(file_extension)
|
||||||
export(getfun)
|
export(getfun)
|
||||||
|
|
|
@ -5,6 +5,6 @@ account: agdamsbo
|
||||||
server: shinyapps.io
|
server: shinyapps.io
|
||||||
hostUrl: https://api.shinyapps.io/v1
|
hostUrl: https://api.shinyapps.io/v1
|
||||||
appId: 13276335
|
appId: 13276335
|
||||||
bundleId: 9334284
|
bundleId: 9334579
|
||||||
url: https://agdamsbo.shinyapps.io/webResearch/
|
url: https://agdamsbo.shinyapps.io/webResearch/
|
||||||
version: 1
|
version: 1
|
||||||
|
|
22
app/server.R
22
app/server.R
|
@ -1,5 +1,23 @@
|
||||||
# project.aid::merge_scripts(list.files("R/",full.names = TRUE),dest = here::here("app/functions.R"))
|
# project.aid::merge_scripts(list.files("R/",full.names = TRUE),dest = here::here("app/functions.R"))
|
||||||
source(here::here("app/functions.R"))
|
# source(here::here("functions.R"))
|
||||||
|
|
||||||
|
source("https://raw.githubusercongittent.com/agdamsbo/webResearch/refs/heads/main/app/functions.R")
|
||||||
|
|
||||||
|
library(readr)
|
||||||
|
library(MASS)
|
||||||
|
library(stats)
|
||||||
|
library(gt)
|
||||||
|
library(gtsummary)
|
||||||
|
library(openxlsx2)
|
||||||
|
library(haven)
|
||||||
|
library(readODS)
|
||||||
|
library(shiny)
|
||||||
|
library(bslib)
|
||||||
|
library(assertthat)
|
||||||
|
library(dplyr)
|
||||||
|
library(quarto)
|
||||||
|
library(here)
|
||||||
|
|
||||||
|
|
||||||
server <- function(input, output, session) {
|
server <- function(input, output, session) {
|
||||||
v <- shiny::reactiveValues(
|
v <- shiny::reactiveValues(
|
||||||
|
@ -108,7 +126,7 @@ server <- function(input, output, session) {
|
||||||
output$report <- downloadHandler(
|
output$report <- downloadHandler(
|
||||||
filename = "analyses.html",
|
filename = "analyses.html",
|
||||||
content = function(file) {
|
content = function(file) {
|
||||||
v$list |> write_quarto(file = file)
|
v$list |> write_quarto(file = file,qmd.file = "www/analyses.qmd")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
18
app/ui.R
18
app/ui.R
|
@ -104,16 +104,16 @@ ui <- bslib::page_sidebar(
|
||||||
),
|
),
|
||||||
actionButton("load", "Analyse", class = "btn-primary")
|
actionButton("load", "Analyse", class = "btn-primary")
|
||||||
)
|
)
|
||||||
# ,
|
,
|
||||||
|
|
||||||
# Horizontal line ----
|
# Horizontal line ----
|
||||||
# tags$hr(),
|
tags$hr(),
|
||||||
# h4("Download results"),
|
h4("Download results"),
|
||||||
#
|
|
||||||
# # Button
|
# Button
|
||||||
# downloadButton(outputId="report",
|
downloadButton(outputId="report",
|
||||||
# label= "Download",
|
label= "Download",
|
||||||
# icon = shiny::icon("download"))
|
icon = shiny::icon("download"))
|
||||||
),
|
),
|
||||||
layout_columns(
|
layout_columns(
|
||||||
cards[[1]]
|
cards[[1]]
|
||||||
|
|
|
@ -7,22 +7,8 @@ params:
|
||||||
data.file: NA
|
data.file: NA
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- ## Abstract -->
|
|
||||||
|
|
||||||
<!-- ### Background -->
|
|
||||||
|
|
||||||
<!-- ### Methods -->
|
|
||||||
|
|
||||||
<!-- ### Results -->
|
|
||||||
|
|
||||||
<!-- ### Conclusion -->
|
|
||||||
|
|
||||||
|
|
||||||
```{r setup}
|
```{r setup}
|
||||||
web_data <- readRDS(file = params$data.file)
|
web_data <- readRDS(file = params$data.file)
|
||||||
# readr::read_rds(file = here::here("data.Rds"))
|
|
||||||
library(gtsummary)
|
|
||||||
library(gt)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
17
man/argsstring2list.Rd
Normal file
17
man/argsstring2list.Rd
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/helpers.R
|
||||||
|
\name{argsstring2list}
|
||||||
|
\alias{argsstring2list}
|
||||||
|
\title{Convert string of arguments to list of arguments}
|
||||||
|
\usage{
|
||||||
|
argsstring2list(string)
|
||||||
|
}
|
||||||
|
\arguments{
|
||||||
|
\item{string}{string to convert to list to use with do.call}
|
||||||
|
}
|
||||||
|
\value{
|
||||||
|
list
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Idea from the answer: https://stackoverflow.com/a/62979238
|
||||||
|
}
|
|
@ -6,11 +6,11 @@
|
||||||
\usage{
|
\usage{
|
||||||
regression_model(
|
regression_model(
|
||||||
data,
|
data,
|
||||||
outcome.str = "gear",
|
outcome.str,
|
||||||
outcome.factor = TRUE,
|
auto.mode = TRUE,
|
||||||
formula.str = NULL,
|
formula.str = NULL,
|
||||||
args.list = list(Hess = TRUE, method = "logistic"),
|
args.list = NULL,
|
||||||
fun = "MASS::polr",
|
fun = NULL,
|
||||||
vars = NULL
|
vars = NULL
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ regression_model(
|
||||||
|
|
||||||
\item{outcome.str}{Name of outcome variable. Character vector.}
|
\item{outcome.str}{Name of outcome variable. Character vector.}
|
||||||
|
|
||||||
\item{outcome.factor}{Factorize outcome variable. Logical.}
|
\item{auto.mode}{Make assumptions on function dependent on outcome data format.}
|
||||||
|
|
||||||
\item{formula.str}{Formula as string. Passed through 'glue::glue'. If given, 'outcome.str' and 'vars' are ignored. Optional.}
|
\item{formula.str}{Formula as string. Passed through 'glue::glue'. If given, 'outcome.str' and 'vars' are ignored. Optional.}
|
||||||
|
|
||||||
|
@ -37,11 +37,10 @@ Print a flexible baseline characteristics table
|
||||||
}
|
}
|
||||||
\examples{
|
\examples{
|
||||||
gtsummary::trial |>
|
gtsummary::trial |>
|
||||||
regression_model(outcome.str = "stage", fun = "MASS::polr")
|
regression_model(outcome.str = "age")
|
||||||
gtsummary::trial |>
|
gtsummary::trial |>
|
||||||
regression_model(
|
regression_model(
|
||||||
outcome.str = "age",
|
outcome.str = "age",
|
||||||
outcome.factor = FALSE,
|
|
||||||
fun = "stats::lm",
|
fun = "stats::lm",
|
||||||
formula.str = "{outcome.str}~.",
|
formula.str = "{outcome.str}~.",
|
||||||
args.list = NULL
|
args.list = NULL
|
||||||
|
|
|
@ -29,7 +29,6 @@ gtsummary::trial |>
|
||||||
gtsummary::trial |>
|
gtsummary::trial |>
|
||||||
regression_model(
|
regression_model(
|
||||||
outcome.str = "age",
|
outcome.str = "age",
|
||||||
outcome.factor = FALSE,
|
|
||||||
fun = "stats::lm",
|
fun = "stats::lm",
|
||||||
formula.str = "{outcome.str}~.",
|
formula.str = "{outcome.str}~.",
|
||||||
args.list = NULL
|
args.list = NULL
|
||||||
|
@ -41,5 +40,5 @@ gtsummary::trial |>
|
||||||
fun = "stats::glm",
|
fun = "stats::glm",
|
||||||
args.list = list(family = binomial(link = "logit"))
|
args.list = list(family = binomial(link = "logit"))
|
||||||
) |>
|
) |>
|
||||||
regression_table(args.list = list(exponentiate = TRUE))
|
regression_table()
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ project.aid::merge_scripts(list.files("R/",full.names = TRUE),dest = here::here(
|
||||||
shiny::runApp(appDir = here::here("app/"), launch.browser = TRUE)
|
shiny::runApp(appDir = here::here("app/"), launch.browser = TRUE)
|
||||||
|
|
||||||
project.aid::deploy_shiny(
|
project.aid::deploy_shiny(
|
||||||
files = c("server.R", "ui.R"),
|
path="app/",
|
||||||
account.name = "agdamsbo",
|
account.name = "agdamsbo",
|
||||||
name.app = "webResearch",
|
name.app = "webResearch",
|
||||||
name.token = "rsconnect_agdamsbo_token",
|
name.token = "rsconnect_agdamsbo_token",
|
||||||
|
|
15
renv.lock
15
renv.lock
|
@ -9,6 +9,21 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Packages": {
|
"Packages": {
|
||||||
|
"MASS": {
|
||||||
|
"Package": "MASS",
|
||||||
|
"Version": "7.3-61",
|
||||||
|
"Source": "Repository",
|
||||||
|
"Repository": "CRAN",
|
||||||
|
"Requirements": [
|
||||||
|
"R",
|
||||||
|
"grDevices",
|
||||||
|
"graphics",
|
||||||
|
"methods",
|
||||||
|
"stats",
|
||||||
|
"utils"
|
||||||
|
],
|
||||||
|
"Hash": "0cafd6f0500e5deba33be22c46bf6055"
|
||||||
|
},
|
||||||
"PKI": {
|
"PKI": {
|
||||||
"Package": "PKI",
|
"Package": "PKI",
|
||||||
"Version": "0.1-14",
|
"Version": "0.1-14",
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue