mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2024-11-22 05:20:23 +01:00
Compare commits
6 Commits
9c61b5e646
...
a181a2816c
Author | SHA1 | Date | |
---|---|---|---|
a181a2816c | |||
c54cea7be0 | |||
e4e4f5a6cc | |||
cdb5311e8b | |||
8816618da8 | |||
f787621f1b |
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,6 +39,8 @@ 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,6 +21,8 @@ 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
7
.lintr
@ -1,7 +0,0 @@
|
|||||||
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.2.1
|
Version: 24.3.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,7 +28,6 @@ Suggests:
|
|||||||
knitr,
|
knitr,
|
||||||
rmarkdown,
|
rmarkdown,
|
||||||
gt,
|
gt,
|
||||||
usethis,
|
|
||||||
ggplot2,
|
ggplot2,
|
||||||
here,
|
here,
|
||||||
styler,
|
styler,
|
||||||
@ -52,7 +51,6 @@ Imports:
|
|||||||
stats,
|
stats,
|
||||||
shiny,
|
shiny,
|
||||||
openxlsx2,
|
openxlsx2,
|
||||||
rsconnect,
|
|
||||||
haven
|
haven
|
||||||
Collate:
|
Collate:
|
||||||
'utils.r'
|
'utils.r'
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
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,3 +1,10 @@
|
|||||||
|
# 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,25 +34,3 @@ 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, )
|
|
||||||
}
|
|
||||||
|
10
app/rsconnect/shinyapps.io/agdamsbo/redcapcast.dcf
Normal file
10
app/rsconnect/shinyapps.io/agdamsbo/redcapcast.dcf
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
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
|
10
app/rsconnect/shinyapps.io/cognitiveindex/shiny_cast.dcf
Normal file
10
app/rsconnect/shinyapps.io/cognitiveindex/shiny_cast.dcf
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
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,21 +1,32 @@
|
|||||||
ui <- shiny::fluidPage(
|
ui <- shiny::shinyUI(
|
||||||
|
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::h5("Please note, that this tool serves as a demonstration of some of the functionality
|
shiny::h4("This tool includes to convenient functions:",
|
||||||
of the REDCapCAST package. No responsibility for data loss or any other
|
shiny::br(),
|
||||||
problems will be taken."),
|
"1) creating a REDCap data dictionary based on a spreadsheet (.csv/.xls(x)/.dta) and",
|
||||||
|
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("REDCap database and dataset"),
|
shiny::h4("1) REDCap datadictionary and compatible dataset"),
|
||||||
shiny::fileInput("ds", "Choose data file",
|
shiny::fileInput("ds", "Choose data file",
|
||||||
multiple = FALSE,
|
multiple = FALSE,
|
||||||
accept = c(
|
accept = c(
|
||||||
@ -26,17 +37,18 @@ ui <- shiny::fluidPage(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
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."),
|
corresponding data dictionary for a new data base, if you want to upload manually."),
|
||||||
# Button
|
# Button
|
||||||
shiny::downloadButton("downloadData", "Download data"),
|
shiny::downloadButton("downloadData", "Download data"),
|
||||||
|
|
||||||
# Button
|
# Button
|
||||||
shiny::downloadButton("downloadMeta", "Download dictionary"),
|
shiny::downloadButton("downloadMeta", "Download datadictionary"),
|
||||||
|
|
||||||
|
|
||||||
# Horizontal line ----
|
# Horizontal line ----
|
||||||
shiny::tags$hr(),
|
shiny::tags$hr(),
|
||||||
shiny::h4("REDCap upload"),
|
shiny::h4("2) 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",
|
||||||
@ -47,9 +59,10 @@ ui <- shiny::fluidPage(
|
|||||||
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 dictionary", icon = shiny::icon("book-bookmark")
|
label = "Upload datadictionary", 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."),
|
||||||
@ -85,5 +98,36 @@ ui <- shiny::fluidPage(
|
|||||||
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
Normal file
BIN
app/www/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
@ -1,23 +0,0 @@
|
|||||||
% 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.0",
|
"Version": "5.2.1",
|
||||||
"Source": "Repository",
|
"Source": "Repository",
|
||||||
"Repository": "CRAN",
|
"Repository": "CRAN",
|
||||||
"Requirements": [
|
"Requirements": [
|
||||||
"R"
|
"R"
|
||||||
],
|
],
|
||||||
"Hash": "ce88d13c0b10fe88a37d9c59dba2d7f9"
|
"Hash": "411ca2c03b1ce5f548345d2fc2685f7a"
|
||||||
},
|
},
|
||||||
"digest": {
|
"digest": {
|
||||||
"Package": "digest",
|
"Package": "digest",
|
||||||
"Version": "0.6.34",
|
"Version": "0.6.35",
|
||||||
"Source": "Repository",
|
"Source": "Repository",
|
||||||
"Repository": "CRAN",
|
"Repository": "CRAN",
|
||||||
"Requirements": [
|
"Requirements": [
|
||||||
"R",
|
"R",
|
||||||
"utils"
|
"utils"
|
||||||
],
|
],
|
||||||
"Hash": "7ede2ee9ea8d3edbf1ca84c1e333ad1a"
|
"Hash": "698ece7ba5a4fa4559e3d537e7ec3d31"
|
||||||
},
|
},
|
||||||
"dplyr": {
|
"dplyr": {
|
||||||
"Package": "dplyr",
|
"Package": "dplyr",
|
||||||
@ -557,18 +557,6 @@
|
|||||||
],
|
],
|
||||||
"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",
|
||||||
@ -686,13 +674,13 @@
|
|||||||
},
|
},
|
||||||
"renv": {
|
"renv": {
|
||||||
"Package": "renv",
|
"Package": "renv",
|
||||||
"Version": "1.0.4",
|
"Version": "1.0.5",
|
||||||
"Source": "Repository",
|
"Source": "Repository",
|
||||||
"Repository": "CRAN",
|
"Repository": "CRAN",
|
||||||
"Requirements": [
|
"Requirements": [
|
||||||
"utils"
|
"utils"
|
||||||
],
|
],
|
||||||
"Hash": "11abaf7c540ff33f94514d50f929bfd1"
|
"Hash": "32c3f93e8360f667ca5863272ec8ba6a"
|
||||||
},
|
},
|
||||||
"rlang": {
|
"rlang": {
|
||||||
"Package": "rlang",
|
"Package": "rlang",
|
||||||
@ -705,35 +693,6 @@
|
|||||||
],
|
],
|
||||||
"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",
|
||||||
@ -880,7 +839,7 @@
|
|||||||
},
|
},
|
||||||
"tidyselect": {
|
"tidyselect": {
|
||||||
"Package": "tidyselect",
|
"Package": "tidyselect",
|
||||||
"Version": "1.2.0",
|
"Version": "1.2.1",
|
||||||
"Source": "Repository",
|
"Source": "Repository",
|
||||||
"Repository": "CRAN",
|
"Repository": "CRAN",
|
||||||
"Requirements": [
|
"Requirements": [
|
||||||
@ -892,7 +851,7 @@
|
|||||||
"vctrs",
|
"vctrs",
|
||||||
"withr"
|
"withr"
|
||||||
],
|
],
|
||||||
"Hash": "79540e5fcd9e0435af547d885f184fd5"
|
"Hash": "829f27b9c4919c16b593794a6344d6c0"
|
||||||
},
|
},
|
||||||
"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.4"
|
version <- "1.0.5"
|
||||||
attr(version, "sha") <- NULL
|
attr(version, "sha") <- NULL
|
||||||
|
|
||||||
# the project directory
|
# the project directory
|
||||||
|
Loading…
Reference in New Issue
Block a user