Compare commits

...

3 Commits

Author SHA1 Message Date
23ebdb5ee7
fixed paste 2024-04-09 10:57:29 +02:00
4cd484bd6b
new version 2024-04-09 10:54:52 +02:00
1bdbb0df94
fix read_redcap_tables 2024-04-09 10:51:31 +02:00
7 changed files with 67 additions and 32 deletions

View File

@ -1,6 +1,6 @@
Package: REDCapCAST Package: REDCapCAST
Title: REDCap Castellated Data Handling Title: REDCap Castellated Data Handling
Version: 24.3.1 Version: 24.4.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,7 +51,8 @@ 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,4 +1,8 @@
# REDCapCAST 24.3.1 - in development # REDCapCAST 24.4.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% unique(m$field_name) fields_test <- fields %in% c(m$field_name,paste0(unique(m$form_name),"_complete"))
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,6 +506,7 @@ 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,
@ -533,8 +534,11 @@ 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 either '.csv', '.xls' or '.xlsx'") stop("Input file format has to be on of:
'.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: 8311272 bundleId:
url: https://agdamsbo.shinyapps.io/redcapcast/ url: https://agdamsbo.shinyapps.io/redcapcast/
version: 1 version: 1

View File

@ -17,4 +17,5 @@ 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,13 +116,14 @@
}, },
"bslib": { "bslib": {
"Package": "bslib", "Package": "bslib",
"Version": "0.6.1", "Version": "0.7.0",
"Source": "Repository", "Source": "Repository",
"Repository": "CRAN", "Repository": "CRAN",
"Requirements": [ "Requirements": [
"R", "R",
"base64enc", "base64enc",
"cachem", "cachem",
"fastmap",
"grDevices", "grDevices",
"htmltools", "htmltools",
"jquerylib", "jquerylib",
@ -133,7 +134,7 @@
"rlang", "rlang",
"sass" "sass"
], ],
"Hash": "c0d8599494bc7fb408cd206bbdd9cab0" "Hash": "8644cc53f43828f19133548195d7e59e"
}, },
"cachem": { "cachem": {
"Package": "cachem", "Package": "cachem",
@ -146,6 +147,18 @@
], ],
"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",
@ -252,17 +265,6 @@
], ],
"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",
@ -390,26 +392,25 @@
}, },
"htmltools": { "htmltools": {
"Package": "htmltools", "Package": "htmltools",
"Version": "0.5.7", "Version": "0.5.8",
"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": "2d7b3857980e0e0d0a1fd6f11928ab0f" "Hash": "149431ee39aba5bdc264112c8ff94444"
}, },
"httpuv": { "httpuv": {
"Package": "httpuv", "Package": "httpuv",
"Version": "1.6.14", "Version": "1.6.15",
"Source": "Repository", "Source": "Repository",
"Repository": "RSPM", "Repository": "CRAN",
"Requirements": [ "Requirements": [
"R", "R",
"R6", "R6",
@ -418,7 +419,7 @@
"promises", "promises",
"utils" "utils"
], ],
"Hash": "16abeb167dbf511f8cc0552efaf05bab" "Hash": "d55aa087c47a63ead0f6fc10f8fa1ee0"
}, },
"httr": { "httr": {
"Package": "httr", "Package": "httr",
@ -542,7 +543,7 @@
}, },
"openxlsx2": { "openxlsx2": {
"Package": "openxlsx2", "Package": "openxlsx2",
"Version": "1.4", "Version": "1.5",
"Source": "Repository", "Source": "Repository",
"Repository": "CRAN", "Repository": "CRAN",
"Requirements": [ "Requirements": [
@ -555,7 +556,7 @@
"utils", "utils",
"zip" "zip"
], ],
"Hash": "9fa7cdc5fbdb1c8511fdde72a944db63" "Hash": "60138955e79b56bf75a99f2b04918d48"
}, },
"pillar": { "pillar": {
"Package": "pillar", "Package": "pillar",
@ -649,6 +650,24 @@
], ],
"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",
@ -672,6 +691,13 @@
], ],
"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",
@ -695,7 +721,7 @@
}, },
"sass": { "sass": {
"Package": "sass", "Package": "sass",
"Version": "0.4.8", "Version": "0.4.9",
"Source": "Repository", "Source": "Repository",
"Repository": "CRAN", "Repository": "CRAN",
"Requirements": [ "Requirements": [
@ -705,11 +731,11 @@
"rappdirs", "rappdirs",
"rlang" "rlang"
], ],
"Hash": "168f9353c76d4c4b0a0bbf72e2c2d035" "Hash": "d53dbfddf695303ea4ad66f86e99b95d"
}, },
"shiny": { "shiny": {
"Package": "shiny", "Package": "shiny",
"Version": "1.8.0", "Version": "1.8.1.1",
"Source": "Repository", "Source": "Repository",
"Repository": "CRAN", "Repository": "CRAN",
"Requirements": [ "Requirements": [
@ -719,7 +745,6 @@
"cachem", "cachem",
"commonmark", "commonmark",
"crayon", "crayon",
"ellipsis",
"fastmap", "fastmap",
"fontawesome", "fontawesome",
"glue", "glue",
@ -739,7 +764,7 @@
"withr", "withr",
"xtable" "xtable"
], ],
"Hash": "3a1f41807d648a908e3c7f0334bf85e6" "Hash": "54b26646816af9960a4c64d8ceec75d6"
}, },
"sodium": { "sodium": {
"Package": "sodium", "Package": "sodium",