mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-19 13:17:30 +02:00
feat: default generic filename and ensure correct suffix
This commit is contained in:
parent
97f482e851
commit
9d0f92d154
2 changed files with 16 additions and 4 deletions
|
|
@ -36,10 +36,16 @@
|
|||
#' # ) |>
|
||||
#' # purrr::pluck("meta") |>
|
||||
#' # export_redcap_instrument(file=here::here(paste0("instrument",Sys.Date(),".zip")))
|
||||
export_redcap_instrument <- function(data,
|
||||
file,
|
||||
export_redcap_instrument <- function(
|
||||
data,
|
||||
file=here::here(paste0("instrument_",Sys.Date(),".zip")),
|
||||
force = FALSE,
|
||||
record.id = "record_id") {
|
||||
# Ensure file name ends with .zip
|
||||
if (!isTRUE(endsWith(file,".zip"))){
|
||||
file <- paste0(file,".zip")
|
||||
}
|
||||
|
||||
# Ensure form name is the same
|
||||
if (force) {
|
||||
data$form_name <- data$form_name[1]
|
||||
|
|
@ -67,9 +73,10 @@ export_redcap_instrument <- function(data,
|
|||
}
|
||||
|
||||
|
||||
#' DEPRICATED Create zips file with necessary content based on data set
|
||||
#' DEPRECATED Create zips file with necessary content based on data set
|
||||
#'
|
||||
#' @description
|
||||
#' Use export_redcap_instrument()
|
||||
#' Metadata can be added by editing the data dictionary of a project in the
|
||||
#' initial design phase. If you want to later add new instruments, this
|
||||
#' function can be used to create (an) instrument(s) to add to a project in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue