Compare commits

..

No commits in common. "23ebdb5ee7a49ac2c46eb1b0bd08f6d5911db114" and "0628bde488267fd4f4c2f89cff3ab705cd3b7ba2" have entirely different histories.

7 changed files with 32 additions and 67 deletions

View File

@ -1,6 +1,6 @@
Package: REDCapCAST Package: REDCapCAST
Title: REDCap Castellated Data Handling Title: REDCap Castellated Data Handling
Version: 24.4.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")),
@ -51,8 +51,7 @@ Imports:
stats, stats,
shiny, shiny,
openxlsx2, openxlsx2,
haven, haven
readODS
Collate: Collate:
'utils.r' 'utils.r'
'process_user_input.r' 'process_user_input.r'

View File

@ -1,8 +1,4 @@
# REDCapCAST 24.4.1 - in development # REDCapCAST 24.3.1 - in development
### Functions
* Fix: `read_redcap_tables()`: field names testing allows to include "[form_name]_complete" fields.
### Documentation and more ### Documentation and more

View File

@ -35,7 +35,7 @@ read_redcap_tables <- function(uri,
REDCapR::redcap_metadata_read(redcap_uri = uri, token = token)[["data"]] REDCapR::redcap_metadata_read(redcap_uri = uri, token = token)[["data"]]
if (!is.null(fields)) { if (!is.null(fields)) {
fields_test <- fields %in% c(m$field_name,paste0(unique(m$form_name),"_complete")) fields_test <- fields %in% unique(m$field_name)
if (any(!fields_test)) { if (any(!fields_test)) {
print(paste0("The following field names are invalid: ", print(paste0("The following field names are invalid: ",

View File

@ -506,7 +506,6 @@ is_repeated_longitudinal <- function(data, generics = c(
#' #'
#' @examples #' @examples
#' file_extension(list.files(here::here(""))[[2]])[[1]] #' file_extension(list.files(here::here(""))[[2]])[[1]]
#' file_extension(c("file.cd..ks","file"))
file_extension <- function(filenames) { file_extension <- function(filenames) {
sub(pattern = "^(.*\\.|[^.]+)(?=[^.]*)", replacement = "", sub(pattern = "^(.*\\.|[^.]+)(?=[^.]*)", replacement = "",
filenames, filenames,
@ -534,11 +533,8 @@ read_input <- function(file, consider.na = c("NA", '""', "")) {
df <- openxlsx2::read_xlsx(file = file, na.strings = consider.na) df <- openxlsx2::read_xlsx(file = file, na.strings = consider.na)
} else if (ext == "dta") { } else if (ext == "dta") {
df <- haven::read_dta(file = file) df <- haven::read_dta(file = file)
} else if (ext == "ods") {
df <- readODS::read_ods(file = file)
} else { } else {
stop("Input file format has to be on of: stop("Input file format has to be either '.csv', '.xls' or '.xlsx'")
'.csv', '.xls', '.xlsx', '.dta' or '.ods'")
} }
}, },
error = function(e) { error = function(e) {

View File

@ -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: 11351429 appId: 11351429
bundleId: bundleId: 8311272
url: https://agdamsbo.shinyapps.io/redcapcast/ url: https://agdamsbo.shinyapps.io/redcapcast/
version: 1 version: 1

View File

@ -17,5 +17,4 @@ Helper to import files correctly
} }
\examples{ \examples{
file_extension(list.files(here::here(""))[[2]])[[1]] file_extension(list.files(here::here(""))[[2]])[[1]]
file_extension(c("file.cd..ks","file"))
} }

View File

@ -116,14 +116,13 @@
}, },
"bslib": { "bslib": {
"Package": "bslib", "Package": "bslib",
"Version": "0.7.0", "Version": "0.6.1",
"Source": "Repository", "Source": "Repository",
"Repository": "CRAN", "Repository": "CRAN",
"Requirements": [ "Requirements": [
"R", "R",
"base64enc", "base64enc",
"cachem", "cachem",
"fastmap",
"grDevices", "grDevices",
"htmltools", "htmltools",
"jquerylib", "jquerylib",
@ -134,7 +133,7 @@
"rlang", "rlang",
"sass" "sass"
], ],
"Hash": "8644cc53f43828f19133548195d7e59e" "Hash": "c0d8599494bc7fb408cd206bbdd9cab0"
}, },
"cachem": { "cachem": {
"Package": "cachem", "Package": "cachem",
@ -147,18 +146,6 @@
], ],
"Hash": "c35768291560ce302c0a6589f92e837d" "Hash": "c35768291560ce302c0a6589f92e837d"
}, },
"cellranger": {
"Package": "cellranger",
"Version": "1.1.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"rematch",
"tibble"
],
"Hash": "f61dbaec772ccd2e17705c1e872e9e7c"
},
"checkmate": { "checkmate": {
"Package": "checkmate", "Package": "checkmate",
"Version": "2.3.1", "Version": "2.3.1",
@ -265,6 +252,17 @@
], ],
"Hash": "fedd9d00c2944ff00a0e2696ccf048ec" "Hash": "fedd9d00c2944ff00a0e2696ccf048ec"
}, },
"ellipsis": {
"Package": "ellipsis",
"Version": "0.3.2",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"rlang"
],
"Hash": "bb0eec2fe32e88d9e2836c2f73ea2077"
},
"fansi": { "fansi": {
"Package": "fansi", "Package": "fansi",
"Version": "1.0.6", "Version": "1.0.6",
@ -392,25 +390,26 @@
}, },
"htmltools": { "htmltools": {
"Package": "htmltools", "Package": "htmltools",
"Version": "0.5.8", "Version": "0.5.7",
"Source": "Repository", "Source": "Repository",
"Repository": "CRAN", "Repository": "CRAN",
"Requirements": [ "Requirements": [
"R", "R",
"base64enc", "base64enc",
"digest", "digest",
"ellipsis",
"fastmap", "fastmap",
"grDevices", "grDevices",
"rlang", "rlang",
"utils" "utils"
], ],
"Hash": "149431ee39aba5bdc264112c8ff94444" "Hash": "2d7b3857980e0e0d0a1fd6f11928ab0f"
}, },
"httpuv": { "httpuv": {
"Package": "httpuv", "Package": "httpuv",
"Version": "1.6.15", "Version": "1.6.14",
"Source": "Repository", "Source": "Repository",
"Repository": "CRAN", "Repository": "RSPM",
"Requirements": [ "Requirements": [
"R", "R",
"R6", "R6",
@ -419,7 +418,7 @@
"promises", "promises",
"utils" "utils"
], ],
"Hash": "d55aa087c47a63ead0f6fc10f8fa1ee0" "Hash": "16abeb167dbf511f8cc0552efaf05bab"
}, },
"httr": { "httr": {
"Package": "httr", "Package": "httr",
@ -543,7 +542,7 @@
}, },
"openxlsx2": { "openxlsx2": {
"Package": "openxlsx2", "Package": "openxlsx2",
"Version": "1.5", "Version": "1.4",
"Source": "Repository", "Source": "Repository",
"Repository": "CRAN", "Repository": "CRAN",
"Requirements": [ "Requirements": [
@ -556,7 +555,7 @@
"utils", "utils",
"zip" "zip"
], ],
"Hash": "60138955e79b56bf75a99f2b04918d48" "Hash": "9fa7cdc5fbdb1c8511fdde72a944db63"
}, },
"pillar": { "pillar": {
"Package": "pillar", "Package": "pillar",
@ -650,24 +649,6 @@
], ],
"Hash": "5e3c5dc0b071b21fa128676560dbe94d" "Hash": "5e3c5dc0b071b21fa128676560dbe94d"
}, },
"readODS": {
"Package": "readODS",
"Version": "2.2.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"cellranger",
"cpp11",
"readr",
"stringi",
"tibble",
"tools",
"vctrs",
"zip"
],
"Hash": "79c0f23a27909659c1a2d62048c15096"
},
"readr": { "readr": {
"Package": "readr", "Package": "readr",
"Version": "2.1.5", "Version": "2.1.5",
@ -691,13 +672,6 @@
], ],
"Hash": "9de96463d2117f6ac49980577939dfb3" "Hash": "9de96463d2117f6ac49980577939dfb3"
}, },
"rematch": {
"Package": "rematch",
"Version": "2.0.0",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "cbff1b666c6fa6d21202f07e2318d4f1"
},
"renv": { "renv": {
"Package": "renv", "Package": "renv",
"Version": "1.0.5", "Version": "1.0.5",
@ -721,7 +695,7 @@
}, },
"sass": { "sass": {
"Package": "sass", "Package": "sass",
"Version": "0.4.9", "Version": "0.4.8",
"Source": "Repository", "Source": "Repository",
"Repository": "CRAN", "Repository": "CRAN",
"Requirements": [ "Requirements": [
@ -731,11 +705,11 @@
"rappdirs", "rappdirs",
"rlang" "rlang"
], ],
"Hash": "d53dbfddf695303ea4ad66f86e99b95d" "Hash": "168f9353c76d4c4b0a0bbf72e2c2d035"
}, },
"shiny": { "shiny": {
"Package": "shiny", "Package": "shiny",
"Version": "1.8.1.1", "Version": "1.8.0",
"Source": "Repository", "Source": "Repository",
"Repository": "CRAN", "Repository": "CRAN",
"Requirements": [ "Requirements": [
@ -745,6 +719,7 @@
"cachem", "cachem",
"commonmark", "commonmark",
"crayon", "crayon",
"ellipsis",
"fastmap", "fastmap",
"fontawesome", "fontawesome",
"glue", "glue",
@ -764,7 +739,7 @@
"withr", "withr",
"xtable" "xtable"
], ],
"Hash": "54b26646816af9960a4c64d8ceec75d6" "Hash": "3a1f41807d648a908e3c7f0334bf85e6"
}, },
"sodium": { "sodium": {
"Package": "sodium", "Package": "sodium",