mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-19 13:17:30 +02:00
exporting redcap instrument from shiny app
This commit is contained in:
parent
7f74ea5144
commit
3e4b1b1549
5 changed files with 182 additions and 54 deletions
46
man/export_redcap_instrument.Rd
Normal file
46
man/export_redcap_instrument.Rd
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
% 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()`}
|
||||
|
||||
\item{record.id}{record id variable name. Default is 'record_id'.}
|
||||
|
||||
\item{dir}{destination dir for the instrument zip. Default is the current WD.}
|
||||
}
|
||||
\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{
|
||||
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")))
|
||||
})
|
||||
|
||||
iris |>
|
||||
ds2dd_detailed(
|
||||
add.auto.id = TRUE
|
||||
) |>
|
||||
purrr::pluck("meta") |>
|
||||
export_redcap_instrument(file=here::here(paste0("instrument",Sys.Date(),".zip")))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue