2024-10-24 11:37:40 +02:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
|
|
|
% Please edit documentation in R/export_redcap_instrument.R
|
|
|
|
\name{export_redcap_instrument}
|
|
|
|
\alias{export_redcap_instrument}
|
|
|
|
\title{Creates zip-file with necessary content to manually add instrument to database}
|
|
|
|
\usage{
|
|
|
|
export_redcap_instrument(data, file, force = FALSE, record.id = "record_id")
|
|
|
|
}
|
|
|
|
\arguments{
|
|
|
|
\item{data}{metadata for the relevant instrument.
|
|
|
|
Could be from `ds2dd_detailed()`}
|
|
|
|
|
2024-10-24 11:56:29 +02:00
|
|
|
\item{file}{destination file name.}
|
|
|
|
|
|
|
|
\item{force}{force instrument creation and ignore different form names by
|
|
|
|
just using the first.}
|
2024-10-24 11:37:40 +02:00
|
|
|
|
2024-10-24 11:56:29 +02:00
|
|
|
\item{record.id}{record id variable name. Default is 'record_id'.}
|
2024-10-24 11:37:40 +02:00
|
|
|
}
|
|
|
|
\value{
|
|
|
|
exports zip-file
|
|
|
|
}
|
|
|
|
\description{
|
|
|
|
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
|
|
|
|
production.
|
|
|
|
}
|
|
|
|
\examples{
|
2024-10-24 11:56:29 +02:00
|
|
|
#iris |>
|
|
|
|
# ds2dd_detailed(
|
|
|
|
# add.auto.id = TRUE,
|
|
|
|
# form.name = sample(c("b", "c"), size = 6, replace = TRUE, prob = rep(.5, 2))
|
|
|
|
# ) |>
|
|
|
|
# purrr::pluck("meta") |>
|
|
|
|
# (\(.x){
|
|
|
|
# split(.x, .x$form_name)
|
|
|
|
# })() |>
|
|
|
|
# purrr::imap(function(.x, .i){
|
|
|
|
# export_redcap_instrument(.x,file=here::here(paste0(.i,Sys.Date(),".zip")))
|
|
|
|
# })
|
2024-10-24 11:37:40 +02:00
|
|
|
|
2024-10-24 11:56:29 +02:00
|
|
|
#iris |>
|
|
|
|
# ds2dd_detailed(
|
|
|
|
# add.auto.id = TRUE
|
|
|
|
# ) |>
|
|
|
|
# purrr::pluck("meta") |>
|
|
|
|
# export_redcap_instrument(file=here::here(paste0("instrument",Sys.Date(),".zip")))
|
2024-10-24 11:37:40 +02:00
|
|
|
}
|