Damsbo A, Egeler P (2024).
REDCapCAST: REDCap Castellated Data Handling.
diff --git a/news/index.html b/news/index.html
index f651a57..28a1d17 100644
--- a/news/index.html
+++ b/news/index.html
@@ -34,9 +34,23 @@
Bug: ‘form.name’ specified to ‘ds2dd_detailed()’ was ignored. Corrected to only be ignored if ‘form.sep’ is specified. Added handling of re-occurring form.sep pattern.
New: Export a REDCap instrument ready to add to your database based on an uploaded spreadsheet. This is thanks to the export_redcap_instrument() function. THis functionality is intended for projects in production and adding instruments should be handled manually and not by API upload.
+
The shiny implementation is included with this package. Implementing in shinylive may be looked into again later.
+
+
REDCapCAST 24.10.3
CRAN release: 2024-10-03
Updated links and spelling.
diff --git a/pkgdown.yml b/pkgdown.yml
index 55fbe1e..35ccda7 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -5,7 +5,7 @@ articles:
Database-creation: Database-creation.html
Introduction: Introduction.html
Shiny-app: Shiny-app.html
-last_built: 2024-10-03T08:56Z
+last_built: 2024-10-24T09:59Z
urls:
reference: https://agdamsbo.github.io/REDCapCAST/reference
article: https://agdamsbo.github.io/REDCapCAST/articles
diff --git a/reference/REDCapCAST-package.html b/reference/REDCapCAST-package.html
index 8d315f3..7602ff7 100644
--- a/reference/REDCapCAST-package.html
+++ b/reference/REDCapCAST-package.html
@@ -40,7 +40,7 @@ Originally forked from the R part of 'REDCapRITS' by Paul Egeler. See https://gi
diff --git a/reference/REDCap_split.html b/reference/REDCap_split.html
index 13b838f..72b88f2 100644
--- a/reference/REDCap_split.html
+++ b/reference/REDCap_split.html
@@ -38,7 +38,7 @@ is used to determine which fields should be included in each resultant table."><
Split REDCap repeating instruments table into multiple tables
diff --git a/reference/clean_redcap_name.html b/reference/clean_redcap_name.html
index 3c744b7..15f4405 100644
--- a/reference/clean_redcap_name.html
+++ b/reference/clean_redcap_name.html
@@ -38,7 +38,7 @@ Trying to make up for different naming conventions.">
diff --git a/reference/create_instrument_meta.html b/reference/create_instrument_meta.html
index cd87b2f..061e09c 100644
--- a/reference/create_instrument_meta.html
+++ b/reference/create_instrument_meta.html
@@ -1,9 +1,11 @@
-Create zips file with necessary content based on data set — create_instrument_meta • REDCapCAST
+DEPRICATED Create zips file with necessary content based on data set — create_instrument_meta • REDCapCASTSkip to contents
@@ -37,15 +39,16 @@ used to add instrument(s) to a project in production.">
-
Create zips file with necessary content based on data set
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 can be
-used to add instrument(s) to a project in production.
+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.
@@ -80,8 +83,13 @@ Default is TRUE.
Examples
data<-iris|>
-ds2dd_detailed(add.auto.id =TRUE,
- form.name=sample(c("b","c"),size =6,replace =TRUE,prob=rep(.5,2)))|>
+ds2dd_detailed(
+ add.auto.id =TRUE,
+ form.name =sample(c("b", "c"),
+ size =6,
+ replace =TRUE, prob =rep(.5, 2)
+)
+)|>purrr::pluck("meta")#> A default id column has been added# data |> create_instrument_meta()
@@ -89,9 +97,42 @@ Default is TRUE.
data<-iris|>ds2dd_detailed(add.auto.id =FALSE)|>purrr::pluck("data")
-names(data)<-glue::glue("{sample(x = c('a','b'),size = length(names(data)),
-replace=TRUE,prob = rep(x=.5,2))}__{names(data)}")
-data<-data|>ds2dd_detailed(form.sep="__")
+iris|>
+setNames(glue::glue("{sample(x = c('a','b'),size = length(ncol(iris)),
+replace=TRUE,prob = rep(x=.5,2))}__{names(iris)}"))|>
+ds2dd_detailed(form.sep ="__")
+#> $data
+#># A tibble: 150 × 5
+#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
+#><dbl><dbl><dbl><dbl><fct>
+#> 1 5.1 3.5 1.4 0.2 setosa
+#> 2 4.9 3 1.4 0.2 setosa
+#> 3 4.7 3.2 1.3 0.2 setosa
+#> 4 4.6 3.1 1.5 0.2 setosa
+#> 5 5 3.6 1.4 0.2 setosa
+#> 6 5.4 3.9 1.7 0.4 setosa
+#> 7 4.6 3.4 1.4 0.3 setosa
+#> 8 5 3.4 1.5 0.2 setosa
+#> 9 4.4 2.9 1.4 0.2 setosa
+#>10 4.9 3.1 1.5 0.1 setosa
+#># ℹ 140 more rows
+#>
+#> $meta
+#># A tibble: 5 × 18
+#> field_name form_name section_header field_type field_label
+#><chr><chr><lgl><chr><chr>
+#>1 Sepal.Length b NA text Sepal.Length
+#>2 Sepal.Width b NA text Sepal.Width
+#>3 Petal.Length b NA text Petal.Length
+#>4 Petal.Width b NA text Petal.Width
+#>5 Species b NA radio Species
+#># ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <lgl>,
+#># text_validation_type_or_show_slider_number <chr>,
+#># text_validation_min <lgl>, text_validation_max <lgl>, identifier <lgl>,
+#># branching_logic <lgl>, required_field <lgl>, custom_alignment <lgl>,
+#># question_number <lgl>, matrix_group_name <lgl>, matrix_ranking <lgl>,
+#># field_annotation <lgl>
+#># data |># purrr::pluck("meta") |># create_instrument_meta(record.id = FALSE)
diff --git a/reference/d2w.html b/reference/d2w.html
index 8cf59d6..fd06f5c 100644
--- a/reference/d2w.html
+++ b/reference/d2w.html
@@ -34,7 +34,7 @@
diff --git a/reference/doc2dd.html b/reference/doc2dd.html
index ad66c2c..058da7e 100644
--- a/reference/doc2dd.html
+++ b/reference/doc2dd.html
@@ -44,7 +44,7 @@ data dictionary, but gives a few options for formatting.">
Doc table to data dictionary - EARLY, DOCS MISSING
diff --git a/reference/ds2dd.html b/reference/ds2dd.html
index c15a5a7..274143e 100644
--- a/reference/ds2dd.html
+++ b/reference/ds2dd.html
@@ -36,7 +36,7 @@ for a more advanced function.">
@@ -87,7 +87,7 @@ ncol(data). Default is NULL and "data" is used.
form.sep
If supplied dataset has form names as suffix or prefix to the
column/variable names, the seperator can be specified. If supplied, the
-form.sep is ignored. Default is NULL.
+form.name is ignored. Default is NULL.
form.prefix
@@ -262,17 +262,17 @@ Please, do always inspect the data dictionary before upload.
#> $meta#># A tibble: 24 × 18#> field_name form_name section_header field_type field_label
-#><chr><lgl><lgl><chr><chr>
-#> 1 record_id NANA text record_id
-#> 2 redcap_event_name NANA text redcap_event_na…
-#> 3 redcap_repeat_instrument NANA text redcap_repeat_i…
-#> 4 redcap_repeat_instance NANA text redcap_repeat_i…
-#> 5 cpr NANA text cpr
-#> 6 inclusion NANA text inclusion
-#> 7 inclusion_time NANA text inclusion_time
-#> 8 dob NANA text dob
-#> 9 age NANA text age
-#>10 age_integer NANA text age_integer
+#><chr><chr><lgl><chr><chr>
+#> 1 record_id data NA text record_id
+#> 2 redcap_event_name data NA text redcap_event_na…
+#> 3 redcap_repeat_instrument data NA text redcap_repeat_i…
+#> 4 redcap_repeat_instance data NA text redcap_repeat_i…
+#> 5 cpr data NA text cpr
+#> 6 inclusion data NA text inclusion
+#> 7 inclusion_time data NA text inclusion_time
+#> 8 dob data NA text dob
+#> 9 age data NA text age
+#>10 age_integer data NA text age_integer #># ℹ 14 more rows#># ℹ 13 more variables: select_choices_or_calculations <lgl>, field_note <lgl>,#># text_validation_type_or_show_slider_number <chr>,
@@ -302,13 +302,13 @@ Please, do always inspect the data dictionary before upload.
#> $meta#># A tibble: 6 × 18#> field_name form_name section_header field_type field_label
-#><chr><lgl><lgl><chr><chr>
-#>1 record_id NANA text record_id
-#>2 sepal.length NANA text sepal.length
-#>3 sepal.width NANA text sepal.width
-#>4 petal.length NANA text petal.length
-#>5 petal.width NANA text petal.width
-#>6 species NANA radio species
+#><chr><chr><lgl><chr><chr>
+#>1 record_id data NA text record_id
+#>2 sepal.length data NA text sepal.length
+#>3 sepal.width data NA text sepal.width
+#>4 petal.length data NA text petal.length
+#>5 petal.width data NA text petal.width
+#>6 species data NA radio species #># ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <lgl>,#># text_validation_type_or_show_slider_number <chr>,#># text_validation_min <lgl>, text_validation_max <lgl>, identifier <lgl>,
@@ -316,6 +316,28 @@ Please, do always inspect the data dictionary before upload.
#># question_number <lgl>, matrix_group_name <lgl>, matrix_ranking <lgl>,#># field_annotation <lgl>#>
+iris|>
+ds2dd_detailed(
+ add.auto.id =TRUE,
+ form.name =sample(c("b", "c"), size =6, replace =TRUE, prob =rep(.5, 2))
+)|>
+purrr::pluck("meta")
+#> A default id column has been added
+#># A tibble: 6 × 18
+#> field_name form_name section_header field_type field_label
+#><chr><chr><lgl><chr><chr>
+#>1 record_id c NA text record_id
+#>2 sepal.length b NA text sepal.length
+#>3 sepal.width b NA text sepal.width
+#>4 petal.length b NA text petal.length
+#>5 petal.width c NA text petal.width
+#>6 species c NA radio species
+#># ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <lgl>,
+#># text_validation_type_or_show_slider_number <chr>,
+#># text_validation_min <lgl>, text_validation_max <lgl>, identifier <lgl>,
+#># branching_logic <lgl>, required_field <lgl>, custom_alignment <lgl>,
+#># question_number <lgl>, matrix_group_name <lgl>, matrix_ranking <lgl>,
+#># field_annotation <lgl>mtcars|>ds2dd_detailed(add.auto.id =TRUE)#> A default id column has been added#> $data
@@ -337,19 +359,19 @@ Please, do always inspect the data dictionary before upload.
#> $meta#># A tibble: 12 × 18#> field_name form_name section_header field_type field_label
-#><chr><lgl><lgl><chr><chr>
-#> 1 record_id NANA text record_id
-#> 2 mpg NANA text mpg
-#> 3 cyl NANA text cyl
-#> 4 disp NANA text disp
-#> 5 hp NANA text hp
-#> 6 drat NANA text drat
-#> 7 wt NANA text wt
-#> 8 qsec NANA text qsec
-#> 9 vs NANA text vs
-#>10 am NANA text am
-#>11 gear NANA text gear
-#>12 carb NANA text carb
+#><chr><chr><lgl><chr><chr>
+#> 1 record_id data NA text record_id
+#> 2 mpg data NA text mpg
+#> 3 cyl data NA text cyl
+#> 4 disp data NA text disp
+#> 5 hp data NA text hp
+#> 6 drat data NA text drat
+#> 7 wt data NA text wt
+#> 8 qsec data NA text qsec
+#> 9 vs data NA text vs
+#>10 am data NA text am
+#>11 gear data NA text gear
+#>12 carb data NA text carb #># ℹ 13 more variables: select_choices_or_calculations <lgl>, field_note <lgl>,#># text_validation_type_or_show_slider_number <chr>,#># text_validation_min <lgl>, text_validation_max <lgl>, identifier <lgl>,
@@ -363,7 +385,7 @@ Please, do always inspect the data dictionary before upload.
#> A default id column has been addednames(data)<-glue::glue("{sample(x = c('a','b'),size = length(names(data)),replace=TRUE,prob = rep(x=.5,2))}__{names(data)}")
-data|>ds2dd_detailed(form.sep="__")
+data|>ds2dd_detailed(form.sep ="__")#> $data#># A tibble: 150 × 6#> record_id sepal.length sepal.width petal.length petal.width species
@@ -387,9 +409,9 @@ Please, do always inspect the data dictionary before upload.
#>1 record_id b NA text record_id #>2 sepal.length b NA text sepal.length#>3 sepal.width b NA text sepal.width
-#>4 petal.length a NA text petal.length
-#>5 petal.width a NA text petal.width
-#>6 species a NA radio species
+#>4 petal.length b NA text petal.length
+#>5 petal.width b NA text petal.width
+#>6 species b NA radio species #># ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <lgl>,#># text_validation_type_or_show_slider_number <chr>,#># text_validation_min <lgl>, text_validation_max <lgl>, identifier <lgl>,
diff --git a/reference/easy_redcap.html b/reference/easy_redcap.html
index 604574b..9f8fb54 100644
--- a/reference/easy_redcap.html
+++ b/reference/easy_redcap.html
@@ -34,7 +34,7 @@
Secure API key storage and data acquisition in one
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.
+
+
+
+
Usage
+
export_redcap_instrument(data, file, force =FALSE, record.id ="record_id")
+
+
+
+
Arguments
+
+
+
data
+
metadata for the relevant instrument.
+Could be from `ds2dd_detailed()`
+
+
+
record.id
+
record id variable name. Default is 'record_id'.
+
+
+
dir
+
destination dir for the instrument zip. Default is the current WD.
+
+
+
+
Value
+
exports zip-file
+
+
+
+
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")))
+})
+#> A default id column has been added
+#>Error in map2(.x, vec_index(.x), .f, ...):ℹ In index: 1.
+#>ℹ With name: b.
+#>Caused by error in `export_redcap_instrument()`:
+#>! could not find function "export_redcap_instrument"
+
+iris|>
+ds2dd_detailed(
+ add.auto.id =TRUE
+)|>
+purrr::pluck("meta")|>
+export_redcap_instrument(file=here::here(paste0("instrument",Sys.Date(),".zip")))
+#>Error in export_redcap_instrument(purrr::pluck(ds2dd_detailed(iris, add.auto.id = TRUE), "meta"), file = here::here(paste0("instrument", Sys.Date(), ".zip"))): could not find function "export_redcap_instrument"
+
diff --git a/reference/guess_time_only_filter.html b/reference/guess_time_only_filter.html
index dfd9932..d918bf4 100644
--- a/reference/guess_time_only_filter.html
+++ b/reference/guess_time_only_filter.html
@@ -40,7 +40,7 @@ has to be converted to character class before REDCap upload.'>
Try at determining which are true time only variables
diff --git a/reference/strsplitx.html b/reference/strsplitx.html
index f20face..6a940de 100644
--- a/reference/strsplitx.html
+++ b/reference/strsplitx.html
@@ -36,7 +36,7 @@ easing the split around the defined delimiter, see example.">
[cpr]<\/span><\/h5> <\/td> <\/tr><\/tbody> <\/table> # create_html_table(text = c(\"CPR nummer\",\"Word\"), variable = c(\"[cpr][1]\", \"[cpr][2]\", \"[test]\"))"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/create_instrument_meta.html","id":null,"dir":"Reference","previous_headings":"","what":"Create zips file with necessary content based on data set — create_instrument_meta","title":"Create zips file with necessary content based on data set — create_instrument_meta","text":"Metadata can added editing data dictionary project initial design phase. want later add new instruments, can used add instrument(s) project production.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/create_instrument_meta.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create zips file with necessary content based on data set — create_instrument_meta","text":"","code":"create_instrument_meta(data, dir = here::here(\"\"), record.id = TRUE)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/create_instrument_meta.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create zips file with necessary content based on data set — create_instrument_meta","text":"data metadata relevant instrument. `ds2dd_detailed()` dir destination dir instrument zip. Default current WD. record.id flag omit first row data dictionary assuming record_id field included instrument. Default TRUE.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/create_instrument_meta.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create zips file with necessary content based on data set — create_instrument_meta","text":"list","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/create_instrument_meta.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create zips file with necessary content based on data set — create_instrument_meta","text":"","code":"data <- iris |> ds2dd_detailed(add.auto.id = TRUE, form.name=sample(c(\"b\",\"c\"),size = 6,replace = TRUE,prob=rep(.5,2))) |> purrr::pluck(\"meta\") #> A default id column has been added # data |> create_instrument_meta() data <- iris |> ds2dd_detailed(add.auto.id = FALSE) |> purrr::pluck(\"data\") names(data) <- glue::glue(\"{sample(x = c('a','b'),size = length(names(data)), replace=TRUE,prob = rep(x=.5,2))}__{names(data)}\") data <- data |> ds2dd_detailed(form.sep=\"__\") # data |> # purrr::pluck(\"meta\") |> # create_instrument_meta(record.id = FALSE)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/d2w.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert single digits to words — d2w","title":"Convert single digits to words — d2w","text":"Convert single digits words","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/d2w.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert single digits to words — d2w","text":"","code":"d2w(x, lang = \"en\", neutrum = FALSE, everything = FALSE)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/d2w.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert single digits to words — d2w","text":"x data. Handle vectors, data.frames lists lang language. Danish (da) English (en), Default \"en\" neutrum numbers depending counted word everything flag also split numbers >9 single digits","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/d2w.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert single digits to words — d2w","text":"returns characters format input","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/d2w.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert single digits to words — d2w","text":"","code":"d2w(c(2:8, 21)) #> [1] \"two\" \"three\" \"four\" \"five\" \"six\" \"seven\" \"eight\" \"21\" d2w(data.frame(2:7, 3:8, 1), lang = \"da\", neutrum = TRUE) #> X2.7 X3.8 X1 #> 1 to tre et #> 2 tre fire et #> 3 fire fem et #> 4 fem seks et #> 5 seks syv et #> 6 syv otte et ## If everything=T, also larger numbers are reduced. ## Elements in the list are same length as input d2w(list(2:8, c(2, 6, 4, 23), 2), everything = TRUE) #> [[1]] #> [1] \"two\" \"three\" \"four\" \"five\" \"six\" \"seven\" \"eight\" #> #> [[2]] #> [1] \"two\" \"six\" \"four\" \"two three\" #> #> [[3]] #> [1] \"two\" #>"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/doc2dd.html","id":null,"dir":"Reference","previous_headings":"","what":"Doc table to data dictionary - EARLY, DOCS MISSING — doc2dd","title":"Doc table to data dictionary - EARLY, DOCS MISSING — doc2dd","text":"Works well `project.aid::docx2list()`. Allows defining database text document (see provided template) easier use data base creation. approach allows easier collaboration defining database. generic case data frame variable names values column. format like REDCap data dictionary, gives options formatting.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/doc2dd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Doc table to data dictionary - EARLY, DOCS MISSING — doc2dd","text":"","code":"doc2dd( data, instrument.name, col.variables = 1, list.datetime.format = list(date_dmy = \"_dat[eo]$\", time_hh_mm_ss = \"_ti[md]e?$\"), col.description = NULL, col.condition = NULL, col.subheader = NULL, subheader.tag = \"h2\", condition.minor.sep = \",\", condition.major.sep = \";\", col.calculation = NULL, col.choices = NULL, choices.char.sep = \"/\", missing.default = NA )"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/doc2dd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Doc table to data dictionary - EARLY, DOCS MISSING — doc2dd","text":"data tibble data.frame variable names one column instrument.name character vector length one. Instrument name. col.variables variable names column (default = 1), allows dplyr subsetting list.datetime.format formatting date/time detection. See `case_match_regex_list()` col.description descriptions column, allows dplyr subsetting. empty, variable names used. col.condition conditions branching column, allows dplyr subsetting. See `char2cond()`. col.subheader sub-header column, allows dplyr subsetting. See `format_subheader()`. subheader.tag formatting tag. Default \"h2\" condition.minor.sep condition split minor. See `char2cond()`. Default \",\". condition.major.sep condition split major. See `char2cond()`. Default \";\". col.calculation calculations column. written exact. Character vector. col.choices choices column. See `char2choice()`. choices.char.sep choices split. See `char2choice()`. Default \"/\". missing.default value missing fields. Default NA.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/doc2dd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Doc table to data dictionary - EARLY, DOCS MISSING — doc2dd","text":"tibble data.frame (data)","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/doc2dd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Doc table to data dictionary - EARLY, DOCS MISSING — doc2dd","text":"","code":"# data <- dd_inst # data |> doc2dd(instrument.name = \"evt\", # col.description = 3, # col.condition = 4, # col.subheader = 2, # col.calculation = 5, # col.choices = 6)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd.html","id":null,"dir":"Reference","previous_headings":"","what":"(DEPRECATED) Data set to data dictionary function — ds2dd","title":"(DEPRECATED) Data set to data dictionary function — ds2dd","text":"Creates basic data dictionary skeleton. Please see `ds2dd_detailed()` advanced function.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"(DEPRECATED) Data set to data dictionary function — ds2dd","text":"","code":"ds2dd( ds, record.id = \"record_id\", form.name = \"basis\", field.type = \"text\", field.label = NULL, include.column.names = FALSE, metadata = metadata_names )"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"(DEPRECATED) Data set to data dictionary function — ds2dd","text":"ds data set record.id name column number id variable, moved first row data dictionary, character integer. Default \"record_id\". form.name vector form names, character string, length 1 length equal number variables. Default \"basis\". field.type vector field types, character string, length 1 length equal number variables. Default \"text. field.label vector form names, character string, length 1 length equal number variables. Default NULL identical field names. include.column.names Flag give detailed output including new column names original data set upload. metadata Metadata column names. Default included REDCapCAST::metadata_names.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"(DEPRECATED) Data set to data dictionary function — ds2dd","text":"data.frame list data.frame vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"(DEPRECATED) Data set to data dictionary function — ds2dd","text":"Migrated stRoke ds2dd(). Fits better functionality 'REDCapCAST'.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"(DEPRECATED) Data set to data dictionary function — ds2dd","text":"","code":"redcapcast_data$record_id <- seq_len(nrow(redcapcast_data)) ds2dd(redcapcast_data, include.column.names=TRUE) #> $DataDictionary #> field_name form_name section_header field_type #> 1 record_id basis NA text #> 2 redcap_event_name basis NA text #> 3 redcap_repeat_instrument basis NA text #> 4 redcap_repeat_instance basis NA text #> 5 cpr basis NA text #> 6 inclusion basis NA text #> 7 inclusion_time basis NA text #> 8 dob basis NA text #> 9 age basis NA text #> 10 age_integer basis NA text #> 11 sex basis NA text #> 12 cohabitation basis NA text #> 13 hypertension basis NA text #> 14 diabetes basis NA text #> 15 region basis NA text #> 16 baseline_data_start_complete basis NA text #> 17 mrs_assessed basis NA text #> 18 mrs_date basis NA text #> 19 mrs_score basis NA text #> 20 mrs_complete basis NA text #> 21 event_datetime basis NA text #> 22 event_age basis NA text #> 23 event_type basis NA text #> 24 new_event_complete basis NA text #> field_label select_choices_or_calculations field_note #> 1 record_id NA NA #> 2 redcap_event_name NA NA #> 3 redcap_repeat_instrument NA NA #> 4 redcap_repeat_instance NA NA #> 5 cpr NA NA #> 6 inclusion NA NA #> 7 inclusion_time NA NA #> 8 dob NA NA #> 9 age NA NA #> 10 age_integer NA NA #> 11 sex NA NA #> 12 cohabitation NA NA #> 13 hypertension NA NA #> 14 diabetes NA NA #> 15 region NA NA #> 16 baseline_data_start_complete NA NA #> 17 mrs_assessed NA NA #> 18 mrs_date NA NA #> 19 mrs_score NA NA #> 20 mrs_complete NA NA #> 21 event_datetime NA NA #> 22 event_age NA NA #> 23 event_type NA NA #> 24 new_event_complete NA NA #> text_validation_type_or_show_slider_number text_validation_min #> 1 NA NA #> 2 NA NA #> 3 NA NA #> 4 NA NA #> 5 NA NA #> 6 NA NA #> 7 NA NA #> 8 NA NA #> 9 NA NA #> 10 NA NA #> 11 NA NA #> 12 NA NA #> 13 NA NA #> 14 NA NA #> 15 NA NA #> 16 NA NA #> 17 NA NA #> 18 NA NA #> 19 NA NA #> 20 NA NA #> 21 NA NA #> 22 NA NA #> 23 NA NA #> 24 NA NA #> text_validation_max identifier branching_logic required_field #> 1 NA NA NA NA #> 2 NA NA NA NA #> 3 NA NA NA NA #> 4 NA NA NA NA #> 5 NA NA NA NA #> 6 NA NA NA NA #> 7 NA NA NA NA #> 8 NA NA NA NA #> 9 NA NA NA NA #> 10 NA NA NA NA #> 11 NA NA NA NA #> 12 NA NA NA NA #> 13 NA NA NA NA #> 14 NA NA NA NA #> 15 NA NA NA NA #> 16 NA NA NA NA #> 17 NA NA NA NA #> 18 NA NA NA NA #> 19 NA NA NA NA #> 20 NA NA NA NA #> 21 NA NA NA NA #> 22 NA NA NA NA #> 23 NA NA NA NA #> 24 NA NA NA NA #> custom_alignment question_number matrix_group_name matrix_ranking #> 1 NA NA NA NA #> 2 NA NA NA NA #> 3 NA NA NA NA #> 4 NA NA NA NA #> 5 NA NA NA NA #> 6 NA NA NA NA #> 7 NA NA NA NA #> 8 NA NA NA NA #> 9 NA NA NA NA #> 10 NA NA NA NA #> 11 NA NA NA NA #> 12 NA NA NA NA #> 13 NA NA NA NA #> 14 NA NA NA NA #> 15 NA NA NA NA #> 16 NA NA NA NA #> 17 NA NA NA NA #> 18 NA NA NA NA #> 19 NA NA NA NA #> 20 NA NA NA NA #> 21 NA NA NA NA #> 22 NA NA NA NA #> 23 NA NA NA NA #> 24 NA NA NA NA #> field_annotation #> 1 NA #> 2 NA #> 3 NA #> 4 NA #> 5 NA #> 6 NA #> 7 NA #> 8 NA #> 9 NA #> 10 NA #> 11 NA #> 12 NA #> 13 NA #> 14 NA #> 15 NA #> 16 NA #> 17 NA #> 18 NA #> 19 NA #> 20 NA #> 21 NA #> 22 NA #> 23 NA #> 24 NA #> #> $`Column names` #> [1] \"record_id\" \"redcap_event_name\" #> [3] \"redcap_repeat_instrument\" \"redcap_repeat_instance\" #> [5] \"cpr\" \"inclusion\" #> [7] \"inclusion_time\" \"dob\" #> [9] \"age\" \"age_integer\" #> [11] \"sex\" \"cohabitation\" #> [13] \"hypertension\" \"diabetes\" #> [15] \"region\" \"baseline_data_start_complete\" #> [17] \"mrs_assessed\" \"mrs_date\" #> [19] \"mrs_score\" \"mrs_complete\" #> [21] \"event_datetime\" \"event_age\" #> [23] \"event_type\" \"new_event_complete\" #>"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd_detailed.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data from stata file for data dictionary — ds2dd_detailed","title":"Extract data from stata file for data dictionary — ds2dd_detailed","text":"Extract data stata file data dictionary","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd_detailed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data from stata file for data dictionary — ds2dd_detailed","text":"","code":"ds2dd_detailed( data, add.auto.id = FALSE, date.format = \"dmy\", form.name = NULL, form.sep = NULL, form.prefix = TRUE, field.type = NULL, field.label = NULL, field.label.attr = \"label\", field.validation = NULL, metadata = names(REDCapCAST::redcapcast_meta), validate.time = FALSE, time.var.sel.pos = \"[Tt]i[d(me)]\", time.var.sel.neg = \"[Dd]at[eo]\" )"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd_detailed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data from stata file for data dictionary — ds2dd_detailed","text":"data data frame add.auto.id flag add id column date.format date format, character string. ymd/dmy/mdy. dafault dmy. form.name manually specify form name(s). Vector length 1 ncol(data). Default NULL \"data\" used. form.sep supplied dataset form names suffix prefix column/variable names, seperator can specified. supplied, form.sep ignored. Default NULL. form.prefix Flag set form prefix (TRUE) suffix (FALSE) column names. Assumes columns pre- suffix specified. field.type manually specify field type(s). Vector length 1 ncol(data). Default NULL \"text\" used everything factors, wil get \"radio\". field.label manually specify field label(s). Vector length 1 ncol(data). Default NULL colnames(data) used attribute `field.label.attr` haven_labelled data set (imported .dta file `haven::read_dta()`). field.label.attr attribute name named labels haven_labelled data set (imported .dta file `haven::read_dta()`. Default \"label\" field.validation manually specify field validation(s). Vector length 1 ncol(data). Default NULL `levels()` used factors attribute `factor.labels.attr` haven_labelled data set (imported .dta file `haven::read_dta()`). metadata redcap metadata headings. Default REDCapCAST:::metadata_names. validate.time Flag validate guessed time columns time.var.sel.pos Positive selection regex string passed `gues_time_only_filter()` sel.pos. time.var.sel.neg Negative selection regex string passed `gues_time_only_filter()` sel.neg.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd_detailed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract data from stata file for data dictionary — ds2dd_detailed","text":"list length 2","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd_detailed.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract data from stata file for data dictionary — ds2dd_detailed","text":"function natural development ds2dd() function. assumes first column ID-column. checks. Please, always inspect data dictionary upload. Ensure, data set formatted much information possible. `field.type` can supplied","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/ds2dd_detailed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract data from stata file for data dictionary — ds2dd_detailed","text":"","code":"data <- REDCapCAST::redcapcast_data data |> ds2dd_detailed(validate.time = TRUE) #> $is.POSIX #> # A tibble: 19 × 2 #> inclusion_time event_datetime #>