Compare commits

..

No commits in common. "e389ec9c28c8d082a498a02849f9a3e85ed0bdb3" and "a84c528815915764b7e9a6b7f6335ee001e64da6" have entirely different histories.

6 changed files with 26 additions and 109 deletions

View File

@ -1,6 +1,6 @@
Package: REDCapCAST Package: REDCapCAST
Title: REDCap Castellated Data Handling Title: REDCap Castellated Data Handling
Version: 24.10.2 Version: 24.9.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")),

View File

@ -1,10 +1,6 @@
# REDCapCAST 24.10.2 # REDCapCAST 24.9.1
Updated links and spelling. Minor changes to pass tests and renv is out.
# REDCapCAST 24.10.1
Minor changes to pass tests and renv is out. `rhub` is really not running as smooth as previously.
# REDCapCAST 24.6.1 # REDCapCAST 24.6.1

View File

@ -37,7 +37,7 @@ Here is just a short description of the main functions:
* `doc2dd()`: Converts a document table to data dictionary. This allows to specify instrument or whole data dictionary in text document, which for most is easier to work with and easily modifiable. Very much like a easy version of just working directly in the data dictionary file itself. * `doc2dd()`: Converts a document table to data dictionary. This allows to specify instrument or whole data dictionary in text document, which for most is easier to work with and easily modifiable. Very much like a easy version of just working directly in the data dictionary file itself.
* `shiny_cast()`: [Shiny](https://shiny.posit.co/) application to ease the process of converting a spreadsheet/data set to a REDCap database. The app runs locally and data is transferred securely. You can just create and upload the data dictionary, but you can also transfer the given data in the same process. The app is [hosted on shinyapps.io](https://agdamsbo.shinyapps.io/redcapcast/) ~~while I work on a [shinylive](https://posit-dev.github.io/r-shinylive/) implementation~~. * `shiny_cast()`: [Shiny](https://www.rstudio.com/products/shiny/) application to ease the process of converting a spreadsheet/data set to a REDCap database. The app runs locally and data is transferred securely. You can just create and upload the data dictionary, but you can also transfer the given data in the same process. The app is [hosted on shinyapps.io](https://agdamsbo.shinyapps.io/redcapcast/) ~~while I work on a [shinylive](https://posit-dev.github.io/r-shinylive/) implementation~~.
## Future ## Future

View File

@ -1,8 +1,11 @@
── R CMD check results ─────────────────────────────────────────────────────────────────────────────── REDCapCAST 24.10.1 ──── ── R CMD check results ───────────────────────────────────────── REDCapCAST 24.6.1 ────
Duration: 23.8s Duration: 22.2s
0 errors ✔ | 0 warnings ✔ | 0 notes ✔ 0 errors ✔ | 0 warnings ✔ | 0 notes ✔
R CMD check succeeded R CMD check succeeded
## Test environments ## Test environments
Rhubv2 runs and checks out. New Rhubv2 implemented and tested with GitHub actions. All passed.
Link corrected.

View File

@ -711,8 +711,13 @@
}, },
"renv": { "renv": {
"Package": "renv", "Package": "renv",
"Version": "1.0.9", "Version": "1.0.7",
"Source": "Repository" "Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"utils"
],
"Hash": "397b7b2a265bc5a7a06852524dabae20"
}, },
"rlang": { "rlang": {
"Package": "rlang", "Package": "rlang",

View File

@ -2,7 +2,7 @@
local({ local({
# the requested version of renv # the requested version of renv
version <- "1.0.9" version <- "1.0.7"
attr(version, "sha") <- NULL attr(version, "sha") <- NULL
# the project directory # the project directory
@ -98,66 +98,6 @@ local({
unloadNamespace("renv") unloadNamespace("renv")
# load bootstrap tools # load bootstrap tools
ansify <- function(text) {
if (renv_ansify_enabled())
renv_ansify_enhanced(text)
else
renv_ansify_default(text)
}
renv_ansify_enabled <- function() {
override <- Sys.getenv("RENV_ANSIFY_ENABLED", unset = NA)
if (!is.na(override))
return(as.logical(override))
pane <- Sys.getenv("RSTUDIO_CHILD_PROCESS_PANE", unset = NA)
if (identical(pane, "build"))
return(FALSE)
testthat <- Sys.getenv("TESTTHAT", unset = "false")
if (tolower(testthat) %in% "true")
return(FALSE)
iderun <- Sys.getenv("R_CLI_HAS_HYPERLINK_IDE_RUN", unset = "false")
if (tolower(iderun) %in% "false")
return(FALSE)
TRUE
}
renv_ansify_default <- function(text) {
text
}
renv_ansify_enhanced <- function(text) {
# R help links
pattern <- "`\\?(renv::(?:[^`])+)`"
replacement <- "`\033]8;;ide:help:\\1\a?\\1\033]8;;\a`"
text <- gsub(pattern, replacement, text, perl = TRUE)
# runnable code
pattern <- "`(renv::(?:[^`])+)`"
replacement <- "`\033]8;;ide:run:\\1\a\\1\033]8;;\a`"
text <- gsub(pattern, replacement, text, perl = TRUE)
# return ansified text
text
}
renv_ansify_init <- function() {
envir <- renv_envir_self()
if (renv_ansify_enabled())
assign("ansify", renv_ansify_enhanced, envir = envir)
else
assign("ansify", renv_ansify_default, envir = envir)
}
`%||%` <- function(x, y) { `%||%` <- function(x, y) {
if (is.null(x)) y else x if (is.null(x)) y else x
} }
@ -202,10 +142,7 @@ local({
# compute common indent # compute common indent
indent <- regexpr("[^[:space:]]", lines) indent <- regexpr("[^[:space:]]", lines)
common <- min(setdiff(indent, -1L)) - leave common <- min(setdiff(indent, -1L)) - leave
text <- paste(substring(lines, common), collapse = "\n") paste(substring(lines, common), collapse = "\n")
# substitute in ANSI links for executable renv code
ansify(text)
} }
@ -369,11 +306,7 @@ local({
) )
if ("headers" %in% names(formals(utils::download.file))) if ("headers" %in% names(formals(utils::download.file)))
{ args$headers <- renv_bootstrap_download_custom_headers(url)
headers <- renv_bootstrap_download_custom_headers(url)
if (length(headers) && is.character(headers))
args$headers <- headers
}
do.call(utils::download.file, args) do.call(utils::download.file, args)
@ -452,22 +385,10 @@ local({
for (type in types) { for (type in types) {
for (repos in renv_bootstrap_repos()) { for (repos in renv_bootstrap_repos()) {
# build arguments for utils::available.packages() call
args <- list(type = type, repos = repos)
# add custom headers if available -- note that
# utils::available.packages() will pass this to download.file()
if ("headers" %in% names(formals(utils::download.file)))
{
headers <- renv_bootstrap_download_custom_headers(url)
if (length(headers) && is.character(headers))
args$headers <- headers
}
# retrieve package database # retrieve package database
db <- tryCatch( db <- tryCatch(
as.data.frame( as.data.frame(
do.call(utils::available.packages, args), utils::available.packages(type = type, repos = repos),
stringsAsFactors = FALSE stringsAsFactors = FALSE
), ),
error = identity error = identity
@ -549,14 +470,6 @@ local({
} }
renv_bootstrap_github_token <- function() {
for (envvar in c("GITHUB_TOKEN", "GITHUB_PAT", "GH_TOKEN")) {
envval <- Sys.getenv(envvar, unset = NA)
if (!is.na(envval))
return(envval)
}
}
renv_bootstrap_download_github <- function(version) { renv_bootstrap_download_github <- function(version) {
enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE") enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE")
@ -564,16 +477,16 @@ local({
return(FALSE) return(FALSE)
# prepare download options # prepare download options
token <- renv_bootstrap_github_token() pat <- Sys.getenv("GITHUB_PAT")
if (nzchar(Sys.which("curl")) && nzchar(token)) { if (nzchar(Sys.which("curl")) && nzchar(pat)) {
fmt <- "--location --fail --header \"Authorization: token %s\"" fmt <- "--location --fail --header \"Authorization: token %s\""
extra <- sprintf(fmt, token) extra <- sprintf(fmt, pat)
saved <- options("download.file.method", "download.file.extra") saved <- options("download.file.method", "download.file.extra")
options(download.file.method = "curl", download.file.extra = extra) options(download.file.method = "curl", download.file.extra = extra)
on.exit(do.call(base::options, saved), add = TRUE) on.exit(do.call(base::options, saved), add = TRUE)
} else if (nzchar(Sys.which("wget")) && nzchar(token)) { } else if (nzchar(Sys.which("wget")) && nzchar(pat)) {
fmt <- "--header=\"Authorization: token %s\"" fmt <- "--header=\"Authorization: token %s\""
extra <- sprintf(fmt, token) extra <- sprintf(fmt, pat)
saved <- options("download.file.method", "download.file.extra") saved <- options("download.file.method", "download.file.extra")
options(download.file.method = "wget", download.file.extra = extra) options(download.file.method = "wget", download.file.extra = extra)
on.exit(do.call(base::options, saved), add = TRUE) on.exit(do.call(base::options, saved), add = TRUE)