mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2024-11-22 13:30:23 +01:00
Compare commits
No commits in common. "a181a2816c038e3b28bde0fea6b3696d80d88e4e" and "9c61b5e646c7512386e85a88fc9a916054b9fcd8" have entirely different histories.
a181a2816c
...
9c61b5e646
4
.github/workflows/R-CMD-check.yaml
vendored
4
.github/workflows/R-CMD-check.yaml
vendored
@ -20,7 +20,7 @@ jobs:
|
|||||||
config:
|
config:
|
||||||
- {os: macos-latest, r: 'release'}
|
- {os: macos-latest, r: 'release'}
|
||||||
- {os: windows-latest, r: 'release'}
|
- {os: windows-latest, r: 'release'}
|
||||||
# - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
|
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
|
||||||
- {os: ubuntu-latest, r: 'release'}
|
- {os: ubuntu-latest, r: 'release'}
|
||||||
- {os: ubuntu-latest, r: 'oldrel-1'}
|
- {os: ubuntu-latest, r: 'oldrel-1'}
|
||||||
|
|
||||||
@ -39,8 +39,6 @@ jobs:
|
|||||||
http-user-agent: ${{ matrix.config.http-user-agent }}
|
http-user-agent: ${{ matrix.config.http-user-agent }}
|
||||||
use-public-rspm: true
|
use-public-rspm: true
|
||||||
|
|
||||||
- uses: r-lib/actions/setup-renv@v2
|
|
||||||
|
|
||||||
- uses: r-lib/actions/setup-r-dependencies@v2
|
- uses: r-lib/actions/setup-r-dependencies@v2
|
||||||
with:
|
with:
|
||||||
extra-packages: any::rcmdcheck
|
extra-packages: any::rcmdcheck
|
||||||
|
2
.github/workflows/test-coverage.yaml
vendored
2
.github/workflows/test-coverage.yaml
vendored
@ -21,8 +21,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
use-public-rspm: true
|
use-public-rspm: true
|
||||||
|
|
||||||
- uses: r-lib/actions/setup-renv@v2
|
|
||||||
|
|
||||||
- uses: r-lib/actions/setup-r-dependencies@v2
|
- uses: r-lib/actions/setup-r-dependencies@v2
|
||||||
with:
|
with:
|
||||||
extra-packages: any::covr
|
extra-packages: any::covr
|
||||||
|
7
.lintr
Normal file
7
.lintr
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
linters: linters_with_defaults(
|
||||||
|
commented_code_linter = NULL
|
||||||
|
)
|
||||||
|
encoding: "UTF-8"
|
||||||
|
exclusions: list(
|
||||||
|
"drafting/"
|
||||||
|
)
|
@ -1,6 +1,6 @@
|
|||||||
Package: REDCapCAST
|
Package: REDCapCAST
|
||||||
Title: REDCap Castellated Data Handling
|
Title: REDCap Castellated Data Handling
|
||||||
Version: 24.3.1
|
Version: 24.2.1
|
||||||
Authors@R: c(
|
Authors@R: c(
|
||||||
person("Andreas Gammelgaard", "Damsbo", email = "agdamsbo@clin.au.dk",
|
person("Andreas Gammelgaard", "Damsbo", email = "agdamsbo@clin.au.dk",
|
||||||
role = c("aut", "cre"),comment = c(ORCID = "0000-0002-7559-1154")),
|
role = c("aut", "cre"),comment = c(ORCID = "0000-0002-7559-1154")),
|
||||||
@ -28,6 +28,7 @@ Suggests:
|
|||||||
knitr,
|
knitr,
|
||||||
rmarkdown,
|
rmarkdown,
|
||||||
gt,
|
gt,
|
||||||
|
usethis,
|
||||||
ggplot2,
|
ggplot2,
|
||||||
here,
|
here,
|
||||||
styler,
|
styler,
|
||||||
@ -51,6 +52,7 @@ Imports:
|
|||||||
stats,
|
stats,
|
||||||
shiny,
|
shiny,
|
||||||
openxlsx2,
|
openxlsx2,
|
||||||
|
rsconnect,
|
||||||
haven
|
haven
|
||||||
Collate:
|
Collate:
|
||||||
'utils.r'
|
'utils.r'
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
export(REDCap_split)
|
export(REDCap_split)
|
||||||
export(clean_redcap_name)
|
export(clean_redcap_name)
|
||||||
export(d2w)
|
export(d2w)
|
||||||
|
export(deploy_shiny)
|
||||||
export(ds2dd)
|
export(ds2dd)
|
||||||
export(ds2dd_detailed)
|
export(ds2dd_detailed)
|
||||||
export(easy_redcap)
|
export(easy_redcap)
|
||||||
|
7
NEWS.md
7
NEWS.md
@ -1,10 +1,3 @@
|
|||||||
# REDCapCAST 24.3.1 - in development
|
|
||||||
|
|
||||||
### Documentation and more
|
|
||||||
|
|
||||||
* Dependencies: In order to deploy `shiny_cast()` with `shinylive`, I need to remove `curl` as a dependency. To accomplish this, the `shiny_deploy()` helper functions has been moved to the package [`pacakge.aid`](https://github.com/agdamsbo/package.aid). This is for a rainy day: https://r-wasm.github.io/rwasm/. The whole shiny part may be migrated to its own project to try to separate things and be easy on dependencies. Time will tell.
|
|
||||||
|
|
||||||
|
|
||||||
# REDCapCAST 24.2.1
|
# REDCapCAST 24.2.1
|
||||||
|
|
||||||
### Functions
|
### Functions
|
||||||
|
@ -34,3 +34,25 @@ shiny_cast <- function() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#' Deploy the Shiny app with rsconnect
|
||||||
|
#'
|
||||||
|
#' @param path app folder path
|
||||||
|
#' @param name.app name of deployed app
|
||||||
|
#'
|
||||||
|
#' @return deploy
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' # deploy_shiny
|
||||||
|
#'
|
||||||
|
deploy_shiny <- function(path = here::here("app/"), name.app = "shiny_cast") {
|
||||||
|
# Connecting
|
||||||
|
rsconnect::setAccountInfo(
|
||||||
|
name = "cognitiveindex",
|
||||||
|
token = keyring::key_get(service = "rsconnect_cognitiveindex_token"),
|
||||||
|
secret = keyring::key_get(service = "rsconnect_cognitiveindex_secret")
|
||||||
|
)
|
||||||
|
|
||||||
|
# Deploying
|
||||||
|
rsconnect::deployApp(appDir = path, lint = TRUE, appName = name.app, )
|
||||||
|
}
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
name: redcapcast
|
|
||||||
title:
|
|
||||||
username: agdamsbo
|
|
||||||
account: agdamsbo
|
|
||||||
server: shinyapps.io
|
|
||||||
hostUrl: https://api.shinyapps.io/v1
|
|
||||||
appId: 11351429
|
|
||||||
bundleId: 8311272
|
|
||||||
url: https://agdamsbo.shinyapps.io/redcapcast/
|
|
||||||
version: 1
|
|
@ -1,10 +0,0 @@
|
|||||||
name: shiny_cast
|
|
||||||
title:
|
|
||||||
username: cognitiveindex
|
|
||||||
account: cognitiveindex
|
|
||||||
server: shinyapps.io
|
|
||||||
hostUrl: https://api.shinyapps.io/v1
|
|
||||||
appId: 11351378
|
|
||||||
bundleId: 8306502
|
|
||||||
url: https://cognitiveindex.shinyapps.io/shiny_cast/
|
|
||||||
version: 1
|
|
66
app/ui.R
66
app/ui.R
@ -1,32 +1,21 @@
|
|||||||
ui <- shiny::shinyUI(
|
ui <- shiny::fluidPage(
|
||||||
shiny::fluidPage(
|
|
||||||
|
|
||||||
## -----------------------------------------------------------------------------
|
## -----------------------------------------------------------------------------
|
||||||
## Application title
|
## Application title
|
||||||
## -----------------------------------------------------------------------------
|
## -----------------------------------------------------------------------------
|
||||||
|
shiny::titlePanel("Simple REDCap data base creation and data upload from data set file via API",
|
||||||
|
windowTitle = "REDCap databse creator"
|
||||||
# customHeaderPanel(title = "REDCapCAST: data base creation and data upload from data set file",
|
|
||||||
# windowTitle = "REDCap database creator"
|
|
||||||
# ),
|
|
||||||
|
|
||||||
shiny::titlePanel(title = shiny::div(shiny::a(shiny::img(src="logo.png"),href="https://agdamsbo.github.io/REDCapCAST"),
|
|
||||||
"Easy REDCap database creation"),
|
|
||||||
windowTitle = "REDCap database creator"
|
|
||||||
),
|
),
|
||||||
shiny::h4("This tool includes to convenient functions:",
|
shiny::h5("Please note, that this tool serves as a demonstration of some of the functionality
|
||||||
shiny::br(),
|
of the REDCapCAST package. No responsibility for data loss or any other
|
||||||
"1) creating a REDCap data dictionary based on a spreadsheet (.csv/.xls(x)/.dta) and",
|
problems will be taken."),
|
||||||
shiny::br(),
|
|
||||||
"2) creating said database on a given REDCap server and uploading the dataset via API access."),
|
|
||||||
|
|
||||||
|
|
||||||
## -----------------------------------------------------------------------------
|
## -----------------------------------------------------------------------------
|
||||||
## Side panel
|
## Side panel
|
||||||
## -----------------------------------------------------------------------------
|
## -----------------------------------------------------------------------------
|
||||||
|
|
||||||
shiny::sidebarPanel(
|
shiny::sidebarPanel(
|
||||||
shiny::h4("1) REDCap datadictionary and compatible dataset"),
|
shiny::h4("REDCap database and dataset"),
|
||||||
shiny::fileInput("ds", "Choose data file",
|
shiny::fileInput("ds", "Choose data file",
|
||||||
multiple = FALSE,
|
multiple = FALSE,
|
||||||
accept = c(
|
accept = c(
|
||||||
@ -37,18 +26,17 @@ ui <- shiny::shinyUI(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
shiny::h6("Below you can download the dataset formatted for upload and the
|
shiny::h6("Below you can download the dataset formatted for upload and the
|
||||||
corresponding data dictionary for a new data base, if you want to upload manually."),
|
corresponding data dictionary for a new data base."),
|
||||||
# Button
|
# Button
|
||||||
shiny::downloadButton("downloadData", "Download data"),
|
shiny::downloadButton("downloadData", "Download data"),
|
||||||
|
|
||||||
# Button
|
# Button
|
||||||
shiny::downloadButton("downloadMeta", "Download datadictionary"),
|
shiny::downloadButton("downloadMeta", "Download dictionary"),
|
||||||
|
|
||||||
|
|
||||||
# Horizontal line ----
|
# Horizontal line ----
|
||||||
shiny::tags$hr(),
|
shiny::tags$hr(),
|
||||||
shiny::h4("2) REDCap upload"),
|
shiny::h4("REDCap upload"),
|
||||||
shiny::h6("This tool is usable for now. Detailed instructions are coming."),
|
|
||||||
shiny::textInput(
|
shiny::textInput(
|
||||||
inputId = "uri",
|
inputId = "uri",
|
||||||
label = "URI",
|
label = "URI",
|
||||||
@ -59,10 +47,9 @@ ui <- shiny::shinyUI(
|
|||||||
label = "API key",
|
label = "API key",
|
||||||
value = ""
|
value = ""
|
||||||
),
|
),
|
||||||
shiny::h6("An API key is an access key to the REDCap database. Please", shiny::a("see here for directions", href="https://www.iths.org/news/redcap-tip/redcap-api-101/"), " to obtain an API key for your project."),
|
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "upload.meta",
|
inputId = "upload.meta",
|
||||||
label = "Upload datadictionary", icon = shiny::icon("book-bookmark")
|
label = "Upload dictionary", icon = shiny::icon("book-bookmark")
|
||||||
),
|
),
|
||||||
shiny::h6("Please note, that before uploading any real data, put your project
|
shiny::h6("Please note, that before uploading any real data, put your project
|
||||||
into production mode."),
|
into production mode."),
|
||||||
@ -98,36 +85,5 @@ ui <- shiny::shinyUI(
|
|||||||
shiny::htmlOutput("upload.data.print", container = shiny::span)
|
shiny::htmlOutput("upload.data.print", container = shiny::span)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
|
||||||
|
|
||||||
|
|
||||||
# close sidebarLayout
|
|
||||||
|
|
||||||
br(),
|
|
||||||
br(),
|
|
||||||
br(),
|
|
||||||
br(),
|
|
||||||
hr(),
|
|
||||||
shiny::tags$footer(shiny::strong("Disclaimer: "),
|
|
||||||
"This tool is aimed at demonstrating use of REDCapCAST. No responsibility for data loss or any other problems will be taken. Please contact me for support.",
|
|
||||||
shiny::br(),
|
|
||||||
shiny::a("License: GPL-3+",href="https://agdamsbo.github.io/REDCapCAST/LICENSE.html"),
|
|
||||||
"|",
|
|
||||||
shiny::a("agdamsbo/REDCapCAST",href="https://agdamsbo.github.io/REDCapCAST"),
|
|
||||||
"|",
|
|
||||||
shiny::a("Source",href="https://github.com/agdamsbo/REDCapCAST"),
|
|
||||||
"|",
|
|
||||||
shiny::a("Contact",href="https://andreas.gdamsbo.dk"),
|
|
||||||
align = "center",
|
|
||||||
style = "
|
|
||||||
position:fixed;
|
|
||||||
bottom:40px;
|
|
||||||
width:100%;
|
|
||||||
height:20px;
|
|
||||||
color: black;
|
|
||||||
padding: 0px;
|
|
||||||
background-color: White;
|
|
||||||
z-index: 100;
|
|
||||||
")
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
BIN
app/www/logo.png
BIN
app/www/logo.png
Binary file not shown.
Before Width: | Height: | Size: 8.1 KiB |
23
man/deploy_shiny.Rd
Normal file
23
man/deploy_shiny.Rd
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/shiny_cast.R
|
||||||
|
\name{deploy_shiny}
|
||||||
|
\alias{deploy_shiny}
|
||||||
|
\title{Deploy the Shiny app with rsconnect}
|
||||||
|
\usage{
|
||||||
|
deploy_shiny(path = here::here("app/"), name.app = "shiny_cast")
|
||||||
|
}
|
||||||
|
\arguments{
|
||||||
|
\item{path}{app folder path}
|
||||||
|
|
||||||
|
\item{name.app}{name of deployed app}
|
||||||
|
}
|
||||||
|
\value{
|
||||||
|
deploy
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Deploy the Shiny app with rsconnect
|
||||||
|
}
|
||||||
|
\examples{
|
||||||
|
# deploy_shiny
|
||||||
|
|
||||||
|
}
|
57
renv.lock
57
renv.lock
@ -210,24 +210,24 @@
|
|||||||
},
|
},
|
||||||
"curl": {
|
"curl": {
|
||||||
"Package": "curl",
|
"Package": "curl",
|
||||||
"Version": "5.2.1",
|
"Version": "5.2.0",
|
||||||
"Source": "Repository",
|
"Source": "Repository",
|
||||||
"Repository": "CRAN",
|
"Repository": "CRAN",
|
||||||
"Requirements": [
|
"Requirements": [
|
||||||
"R"
|
"R"
|
||||||
],
|
],
|
||||||
"Hash": "411ca2c03b1ce5f548345d2fc2685f7a"
|
"Hash": "ce88d13c0b10fe88a37d9c59dba2d7f9"
|
||||||
},
|
},
|
||||||
"digest": {
|
"digest": {
|
||||||
"Package": "digest",
|
"Package": "digest",
|
||||||
"Version": "0.6.35",
|
"Version": "0.6.34",
|
||||||
"Source": "Repository",
|
"Source": "Repository",
|
||||||
"Repository": "CRAN",
|
"Repository": "CRAN",
|
||||||
"Requirements": [
|
"Requirements": [
|
||||||
"R",
|
"R",
|
||||||
"utils"
|
"utils"
|
||||||
],
|
],
|
||||||
"Hash": "698ece7ba5a4fa4559e3d537e7ec3d31"
|
"Hash": "7ede2ee9ea8d3edbf1ca84c1e333ad1a"
|
||||||
},
|
},
|
||||||
"dplyr": {
|
"dplyr": {
|
||||||
"Package": "dplyr",
|
"Package": "dplyr",
|
||||||
@ -557,6 +557,18 @@
|
|||||||
],
|
],
|
||||||
"Hash": "9fa7cdc5fbdb1c8511fdde72a944db63"
|
"Hash": "9fa7cdc5fbdb1c8511fdde72a944db63"
|
||||||
},
|
},
|
||||||
|
"packrat": {
|
||||||
|
"Package": "packrat",
|
||||||
|
"Version": "0.9.2",
|
||||||
|
"Source": "Repository",
|
||||||
|
"Repository": "CRAN",
|
||||||
|
"Requirements": [
|
||||||
|
"R",
|
||||||
|
"tools",
|
||||||
|
"utils"
|
||||||
|
],
|
||||||
|
"Hash": "55ddd2d4a1959535f18393478b0c14a6"
|
||||||
|
},
|
||||||
"pillar": {
|
"pillar": {
|
||||||
"Package": "pillar",
|
"Package": "pillar",
|
||||||
"Version": "1.9.0",
|
"Version": "1.9.0",
|
||||||
@ -674,13 +686,13 @@
|
|||||||
},
|
},
|
||||||
"renv": {
|
"renv": {
|
||||||
"Package": "renv",
|
"Package": "renv",
|
||||||
"Version": "1.0.5",
|
"Version": "1.0.4",
|
||||||
"Source": "Repository",
|
"Source": "Repository",
|
||||||
"Repository": "CRAN",
|
"Repository": "CRAN",
|
||||||
"Requirements": [
|
"Requirements": [
|
||||||
"utils"
|
"utils"
|
||||||
],
|
],
|
||||||
"Hash": "32c3f93e8360f667ca5863272ec8ba6a"
|
"Hash": "11abaf7c540ff33f94514d50f929bfd1"
|
||||||
},
|
},
|
||||||
"rlang": {
|
"rlang": {
|
||||||
"Package": "rlang",
|
"Package": "rlang",
|
||||||
@ -693,6 +705,35 @@
|
|||||||
],
|
],
|
||||||
"Hash": "42548638fae05fd9a9b5f3f437fbbbe2"
|
"Hash": "42548638fae05fd9a9b5f3f437fbbbe2"
|
||||||
},
|
},
|
||||||
|
"rsconnect": {
|
||||||
|
"Package": "rsconnect",
|
||||||
|
"Version": "1.2.1",
|
||||||
|
"Source": "Repository",
|
||||||
|
"Repository": "CRAN",
|
||||||
|
"Requirements": [
|
||||||
|
"R",
|
||||||
|
"cli",
|
||||||
|
"curl",
|
||||||
|
"digest",
|
||||||
|
"jsonlite",
|
||||||
|
"lifecycle",
|
||||||
|
"openssl",
|
||||||
|
"packrat",
|
||||||
|
"renv",
|
||||||
|
"rlang",
|
||||||
|
"rstudioapi",
|
||||||
|
"tools",
|
||||||
|
"yaml"
|
||||||
|
],
|
||||||
|
"Hash": "94bb3a2125b01b13dd2e4a784c2a9639"
|
||||||
|
},
|
||||||
|
"rstudioapi": {
|
||||||
|
"Package": "rstudioapi",
|
||||||
|
"Version": "0.15.0",
|
||||||
|
"Source": "Repository",
|
||||||
|
"Repository": "CRAN",
|
||||||
|
"Hash": "5564500e25cffad9e22244ced1379887"
|
||||||
|
},
|
||||||
"sass": {
|
"sass": {
|
||||||
"Package": "sass",
|
"Package": "sass",
|
||||||
"Version": "0.4.8",
|
"Version": "0.4.8",
|
||||||
@ -839,7 +880,7 @@
|
|||||||
},
|
},
|
||||||
"tidyselect": {
|
"tidyselect": {
|
||||||
"Package": "tidyselect",
|
"Package": "tidyselect",
|
||||||
"Version": "1.2.1",
|
"Version": "1.2.0",
|
||||||
"Source": "Repository",
|
"Source": "Repository",
|
||||||
"Repository": "CRAN",
|
"Repository": "CRAN",
|
||||||
"Requirements": [
|
"Requirements": [
|
||||||
@ -851,7 +892,7 @@
|
|||||||
"vctrs",
|
"vctrs",
|
||||||
"withr"
|
"withr"
|
||||||
],
|
],
|
||||||
"Hash": "829f27b9c4919c16b593794a6344d6c0"
|
"Hash": "79540e5fcd9e0435af547d885f184fd5"
|
||||||
},
|
},
|
||||||
"tzdb": {
|
"tzdb": {
|
||||||
"Package": "tzdb",
|
"Package": "tzdb",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
local({
|
local({
|
||||||
|
|
||||||
# the requested version of renv
|
# the requested version of renv
|
||||||
version <- "1.0.5"
|
version <- "1.0.4"
|
||||||
attr(version, "sha") <- NULL
|
attr(version, "sha") <- NULL
|
||||||
|
|
||||||
# the project directory
|
# the project directory
|
||||||
|
Loading…
Reference in New Issue
Block a user