Patient ID <\/span><\/h5> <\/td> [cpr]<\/span><\/h5> <\/td> <\/tr><\/tbody> <\/table> create_html_table(text = paste(\"assessor\", 1:2, sep = \"_\"), variable = c(\"[cpr]\")) #> assessor_1 <\/span><\/h5> <\/td> [cpr]<\/span><\/h5> <\/td> <\/tr> assessor_2 <\/span><\/h5> <\/td> [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":"DEPRICATED Create zips file with necessary content based on data set — create_instrument_meta","title":"DEPRICATED 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, function can used create () instrument(s) add project production.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/create_instrument_meta.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"DEPRICATED 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":"DEPRICATED 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":"DEPRICATED 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":"DEPRICATED 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\") 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 #> #> 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 #> #> 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 , field_note , #> # text_validation_type_or_show_slider_number , #> # text_validation_min , text_validation_max , identifier , #> # branching_logic , required_field , custom_alignment , #> # question_number , matrix_group_name , matrix_ranking , #> # field_annotation #> # 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 con_mrs basis NA text #> 22 con_calc basis NA text #> 23 consensus_complete basis NA text #> 24 event_datetime basis NA text #> 25 event_age basis NA text #> 26 event_type basis NA text #> 27 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 con_mrs NA NA #> 22 con_calc NA NA #> 23 consensus_complete NA NA #> 24 event_datetime NA NA #> 25 event_age NA NA #> 26 event_type NA NA #> 27 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 #> 25 NA NA #> 26 NA NA #> 27 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 #> 25 NA NA NA NA #> 26 NA NA NA NA #> 27 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 #> 25 NA NA NA NA #> 26 NA NA NA NA #> 27 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 #> 25 NA #> 26 NA #> 27 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] \"con_mrs\" \"con_calc\" #> [23] \"consensus_complete\" \"event_datetime\" #> [25] \"event_age\" \"event_type\" #> [27] \"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), convert.logicals = TRUE )"},{"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.name 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. convert.logicals convert logicals factor. Default TRUE.","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() #> $data #> # A tibble: 25 × 27 #> record_id redcap_event_name redcap_repeat_instrument redcap_repeat_instance #> #> 1 1 inclusion NA NA #> 2 2 inclusion NA NA #> 3 2 follow1 NA NA #> 4 2 follow1 New Event (?) 1 #> 5 3 inclusion NA NA #> 6 3 follow1 NA NA #> 7 3 follow2 NA NA #> 8 3 follow1 New Event (?) 1 #> 9 3 follow1 New Event (?) 2 #> 10 3 follow2 New Event (?) 1 #> # ℹ 15 more rows #> # ℹ 23 more variables: cpr , inclusion , inclusion_time , #> # dob , age , age_integer , sex , cohabitation , #> # hypertension , diabetes , region , #> # baseline_data_start_complete , mrs_assessed , mrs_date , #> # mrs_score , mrs_complete , con_mrs , con_calc , #> # consensus_complete , event_datetime , event_age , … #> #> $meta #> # A tibble: 27 × 18 #> field_name form_name section_header field_type field_label #> #> 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 #> # ℹ 17 more rows #> # ℹ 13 more variables: select_choices_or_calculations , field_note , #> # text_validation_type_or_show_slider_number , #> # text_validation_min , text_validation_max , identifier , #> # branching_logic , required_field , custom_alignment , #> # question_number , matrix_group_name , matrix_ranking , #> # field_annotation #> iris |> ds2dd_detailed(add.auto.id = TRUE) #> A default id column has been added #> $data #> # A tibble: 150 × 6 #> record_id sepal.length sepal.width petal.length petal.width species #> #> 1 1 5.1 3.5 1.4 0.2 setosa #> 2 2 4.9 3 1.4 0.2 setosa #> 3 3 4.7 3.2 1.3 0.2 setosa #> 4 4 4.6 3.1 1.5 0.2 setosa #> 5 5 5 3.6 1.4 0.2 setosa #> 6 6 5.4 3.9 1.7 0.4 setosa #> 7 7 4.6 3.4 1.4 0.3 setosa #> 8 8 5 3.4 1.5 0.2 setosa #> 9 9 4.4 2.9 1.4 0.2 setosa #> 10 10 4.9 3.1 1.5 0.1 setosa #> # ℹ 140 more rows #> #> $meta #> # A tibble: 6 × 18 #> field_name form_name section_header field_type field_label #> #> 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 , field_note , #> # text_validation_type_or_show_slider_number , #> # text_validation_min , text_validation_max , identifier , #> # branching_logic , required_field , custom_alignment , #> # question_number , matrix_group_name , matrix_ranking , #> # field_annotation #> 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 #> #> 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 , field_note , #> # text_validation_type_or_show_slider_number , #> # text_validation_min , text_validation_max , identifier , #> # branching_logic , required_field , custom_alignment , #> # question_number , matrix_group_name , matrix_ranking , #> # field_annotation mtcars |> ds2dd_detailed(add.auto.id = TRUE) #> A default id column has been added #> $data #> # A tibble: 32 × 12 #> record_id mpg cyl disp hp drat wt qsec vs am gear carb #> #> 1 1 21 6 160 110 3.9 2.62 16.5 0 1 4 4 #> 2 2 21 6 160 110 3.9 2.88 17.0 0 1 4 4 #> 3 3 22.8 4 108 93 3.85 2.32 18.6 1 1 4 1 #> 4 4 21.4 6 258 110 3.08 3.22 19.4 1 0 3 1 #> 5 5 18.7 8 360 175 3.15 3.44 17.0 0 0 3 2 #> 6 6 18.1 6 225 105 2.76 3.46 20.2 1 0 3 1 #> 7 7 14.3 8 360 245 3.21 3.57 15.8 0 0 3 4 #> 8 8 24.4 4 147. 62 3.69 3.19 20 1 0 4 2 #> 9 9 22.8 4 141. 95 3.92 3.15 22.9 1 0 4 2 #> 10 10 19.2 6 168. 123 3.92 3.44 18.3 1 0 4 4 #> # ℹ 22 more rows #> #> $meta #> # A tibble: 12 × 18 #> field_name form_name section_header field_type field_label #> #> 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 , field_note , #> # text_validation_type_or_show_slider_number , #> # text_validation_min , text_validation_max , identifier , #> # branching_logic , required_field , custom_alignment , #> # question_number , matrix_group_name , matrix_ranking , #> # field_annotation #> data <- iris |> ds2dd_detailed(add.auto.id = TRUE) |> purrr::pluck(\"data\") #> A default id column has been added names(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 #> # A tibble: 150 × 6 #> record_id sepal.length sepal.width petal.length petal.width species #> #> 1 1 5.1 3.5 1.4 0.2 setosa #> 2 2 4.9 3 1.4 0.2 setosa #> 3 3 4.7 3.2 1.3 0.2 setosa #> 4 4 4.6 3.1 1.5 0.2 setosa #> 5 5 5 3.6 1.4 0.2 setosa #> 6 6 5.4 3.9 1.7 0.4 setosa #> 7 7 4.6 3.4 1.4 0.3 setosa #> 8 8 5 3.4 1.5 0.2 setosa #> 9 9 4.4 2.9 1.4 0.2 setosa #> 10 10 4.9 3.1 1.5 0.1 setosa #> # ℹ 140 more rows #> #> $meta #> # A tibble: 6 × 18 #> field_name form_name section_header field_type field_label #> #> 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 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 , field_note , #> # text_validation_type_or_show_slider_number , #> # text_validation_min , text_validation_max , identifier , #> # branching_logic , required_field , custom_alignment , #> # question_number , matrix_group_name , matrix_ranking , #> # field_annotation #>"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/easy_redcap.html","id":null,"dir":"Reference","previous_headings":"","what":"Secure API key storage and data acquisition in one — easy_redcap","title":"Secure API key storage and data acquisition in one — easy_redcap","text":"Secure API key storage data acquisition one","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/easy_redcap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Secure API key storage and data acquisition in one — easy_redcap","text":"","code":"easy_redcap(project.name, widen.data = TRUE, uri, ...)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/easy_redcap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Secure API key storage and data acquisition in one — easy_redcap","text":"project.name name current project (key storage `keyring::key_set()`, using default keyring) widen.data argument widen exported data uri REDCap database API uri ... arguments passed `REDCapCAST::read_redcap_tables()`","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/easy_redcap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Secure API key storage and data acquisition in one — easy_redcap","text":"data.frame list depending widen.data","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/export_redcap_instrument.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates zip-file with necessary content to manually add instrument to database — export_redcap_instrument","title":"Creates zip-file with necessary content to manually add instrument to database — export_redcap_instrument","text":"Metadata can added editing data dictionary project initial design phase. want later add new instruments, function can used create () instrument(s) add project production.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/export_redcap_instrument.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates zip-file with necessary content to manually add instrument to database — export_redcap_instrument","text":"","code":"export_redcap_instrument(data, file, force = FALSE, record.id = \"record_id\")"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/export_redcap_instrument.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates zip-file with necessary content to manually add instrument to database — export_redcap_instrument","text":"data metadata relevant instrument. `ds2dd_detailed()` file destination file name. force force instrument creation ignore different form names just using first. record.id record id variable name. Default 'record_id'.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/export_redcap_instrument.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Creates zip-file with necessary content to manually add instrument to database — export_redcap_instrument","text":"exports zip-file","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/export_redcap_instrument.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates zip-file with necessary content to manually add instrument to database — export_redcap_instrument","text":"","code":"#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\")))"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/file_extension.html","id":null,"dir":"Reference","previous_headings":"","what":"DEPRECATED Helper to import files correctly — file_extension","title":"DEPRECATED Helper to import files correctly — file_extension","text":"DEPRECATED Helper import files correctly","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/file_extension.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"DEPRECATED Helper to import files correctly — file_extension","text":"","code":"file_extension(filenames)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/file_extension.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"DEPRECATED Helper to import files correctly — file_extension","text":"filenames file names","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/file_extension.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"DEPRECATED Helper to import files correctly — file_extension","text":"character vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/file_extension.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"DEPRECATED Helper to import files correctly — file_extension","text":"","code":"file_extension(list.files(here::here(\"\"))[[2]])[[1]] #> [1] \"\" file_extension(c(\"file.cd..ks\", \"file\")) #> [1] \"ks\" \"\""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/focused_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"focused_metadata — focused_metadata","title":"focused_metadata — focused_metadata","text":"Extracts limited metadata variables dataset","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/focused_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"focused_metadata — focused_metadata","text":"","code":"focused_metadata(metadata, vars_in_data)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/focused_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"focused_metadata — focused_metadata","text":"metadata dataframe containing metadata vars_in_data Vector variable names dataset","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/focused_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"focused_metadata — focused_metadata","text":"dataframe containing metadata variables dataset","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/format_subheader.html","id":null,"dir":"Reference","previous_headings":"","what":"Sub-header formatting wrapper — format_subheader","title":"Sub-header formatting wrapper — format_subheader","text":"Sub-header formatting wrapper","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/format_subheader.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sub-header formatting wrapper — format_subheader","text":"","code":"format_subheader(data, tag = \"h2\")"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/format_subheader.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sub-header formatting wrapper — format_subheader","text":"data character vector tag character vector length 1","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/format_subheader.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sub-header formatting wrapper — format_subheader","text":"character vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/format_subheader.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sub-header formatting wrapper — format_subheader","text":"","code":"\"Instrument header\" |> format_subheader() #> Instrument header<\/h2><\/div>"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Retrieve project API key if stored, if not, set and retrieve — get_api_key","title":"Retrieve project API key if stored, if not, set and retrieve — get_api_key","text":"Retrieve project API key stored, , set retrieve","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Retrieve project API key if stored, if not, set and retrieve — get_api_key","text":"","code":"get_api_key(key.name)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_api_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Retrieve project API key if stored, if not, set and retrieve — get_api_key","text":"key.name character vector key name","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_api_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Retrieve project API key if stored, if not, set and retrieve — get_api_key","text":"character vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_attr.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract attribute. Returns NA if none — get_attr","title":"Extract attribute. Returns NA if none — get_attr","text":"Extract attribute. Returns NA none","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_attr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract attribute. Returns NA if none — get_attr","text":"","code":"get_attr(data, attr = NULL)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_attr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract attribute. Returns NA if none — get_attr","text":"data vector attr attribute name","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_attr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract attribute. Returns NA if none — get_attr","text":"character vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_attr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract attribute. Returns NA if none — get_attr","text":"","code":"attr(mtcars$mpg, \"label\") <- \"testing\" sapply(mtcars, get_attr) #> $mpg #> $mpg$label #> [1] \"testing\" #> #> #> $cyl #> NULL #> #> $disp #> NULL #> #> $hp #> NULL #> #> $drat #> NULL #> #> $wt #> NULL #> #> $qsec #> NULL #> #> $vs #> NULL #> #> $am #> NULL #> #> $gear #> NULL #> #> $carb #> NULL #> lapply(mtcars, \\(.x)get_attr(.x, NULL)) #> $mpg #> $mpg$label #> [1] \"testing\" #> #> #> $cyl #> NULL #> #> $disp #> NULL #> #> $hp #> NULL #> #> $drat #> NULL #> #> $wt #> NULL #> #> $qsec #> NULL #> #> $vs #> NULL #> #> $am #> NULL #> #> $gear #> NULL #> #> $carb #> NULL #> mtcars |> numchar2fct(numeric.threshold = 6) |> ds2dd_detailed() #> $data #> # A tibble: 32 × 11 #> mpg cyl disp hp drat wt qsec vs am gear carb #> #> 1 21 6 160 110 3.9 2.62 16.5 0 1 4 4 #> 2 21 6 160 110 3.9 2.88 17.0 0 1 4 4 #> 3 22.8 4 108 93 3.85 2.32 18.6 1 1 4 1 #> 4 21.4 6 258 110 3.08 3.22 19.4 1 0 3 1 #> 5 18.7 8 360 175 3.15 3.44 17.0 0 0 3 2 #> 6 18.1 6 225 105 2.76 3.46 20.2 1 0 3 1 #> 7 14.3 8 360 245 3.21 3.57 15.8 0 0 3 4 #> 8 24.4 4 147. 62 3.69 3.19 20 1 0 4 2 #> 9 22.8 4 141. 95 3.92 3.15 22.9 1 0 4 2 #> 10 19.2 6 168. 123 3.92 3.44 18.3 1 0 4 4 #> # ℹ 22 more rows #> #> $meta #> # A tibble: 11 × 18 #> field_name form_name section_header field_type field_label #> #> 1 mpg data NA text testing #> 2 cyl data NA radio cyl #> 3 disp data NA text disp #> 4 hp data NA text hp #> 5 drat data NA text drat #> 6 wt data NA text wt #> 7 qsec data NA text qsec #> 8 vs data NA radio vs #> 9 am data NA radio am #> 10 gear data NA radio gear #> 11 carb data NA radio carb #> # ℹ 13 more variables: select_choices_or_calculations , field_note , #> # text_validation_type_or_show_slider_number , #> # text_validation_min , text_validation_max , identifier , #> # branching_logic , required_field , custom_alignment , #> # question_number , matrix_group_name , matrix_ranking , #> # field_annotation #>"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_id_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the id name — get_id_name","title":"Get the id name — get_id_name","text":"Get id name","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_id_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the id name — get_id_name","text":"","code":"get_id_name(data)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_id_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the id name — get_id_name","text":"data data frame list","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/get_id_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the id name — get_id_name","text":"character vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/guess_time_only.html","id":null,"dir":"Reference","previous_headings":"","what":"Guess time variables based on naming pattern — guess_time_only","title":"Guess time variables based on naming pattern — guess_time_only","text":"repairing data time variables appended \"1970-01-01\"","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/guess_time_only.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Guess time variables based on naming pattern — guess_time_only","text":"","code":"guess_time_only( data, 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/guess_time_only.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Guess time variables based on naming pattern — guess_time_only","text":"data data.frame tibble 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/guess_time_only.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Guess time variables based on naming pattern — guess_time_only","text":"data.frame tibble","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/guess_time_only.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Guess time variables based on naming pattern — guess_time_only","text":"","code":"redcapcast_data |> guess_time_only(validate.time = TRUE) #> $is.POSIX #> # A tibble: 25 × 2 #> inclusion_time event_datetime #> #> 1 12:38:49 NA #> 2 10:38:57 NA #> 3 NA NA #> 4 NA 2024-01-18 12:49:42 #> 5 12:01:07 NA #> 6 NA NA #> 7 NA NA #> 8 NA 2024-01-18 12:49:58 #> 9 NA 2024-01-18 12:50:01 #> 10 NA 2024-01-18 12:50:05 #> # ℹ 15 more rows #> #> $is.datetime #> # A tibble: 25 × 1 #> event_datetime #> #> 1 NA #> 2 NA #> 3 NA #> 4 2024-01-18 12:49:42 #> 5 NA #> 6 NA #> 7 NA #> 8 2024-01-18 12:49:58 #> 9 2024-01-18 12:50:01 #> 10 2024-01-18 12:50:05 #> # ℹ 15 more rows #> #> $is.time_only #> # A tibble: 25 × 1 #> inclusion_time #> #> 1 12:38:49 #> 2 10:38:57 #> 3 NA #> 4 NA #> 5 12:01:07 #> 6 NA #> 7 NA #> 8 NA #> 9 NA #> 10 NA #> # ℹ 15 more rows #>"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/guess_time_only_filter.html","id":null,"dir":"Reference","previous_headings":"","what":"Try at determining which are true time only variables — guess_time_only_filter","title":"Try at determining which are true time only variables — guess_time_only_filter","text":"just try guessing data type based data class column names hoping tiny bit naming consistency. R include time-data format natively, \"hms\" class `readr` used. converted character class REDCap upload.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/guess_time_only_filter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Try at determining which are true time only variables — guess_time_only_filter","text":"","code":"guess_time_only_filter( data, validate = FALSE, sel.pos = \"[Tt]i[d(me)]\", sel.neg = \"[Dd]at[eo]\" )"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/guess_time_only_filter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Try at determining which are true time only variables — guess_time_only_filter","text":"data data set validate flag output validation data. output list. sel.pos Positive selection regex string sel.neg Negative selection regex string","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/guess_time_only_filter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Try at determining which are true time only variables — guess_time_only_filter","text":"character vector list depending `validate` flag.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/guess_time_only_filter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Try at determining which are true time only variables — guess_time_only_filter","text":"","code":"data <- redcapcast_data data |> guess_time_only_filter() #> [1] \"inclusion_time\" data |> guess_time_only_filter(validate = TRUE) |> lapply(head) #> $is.POSIX #> # A tibble: 6 × 2 #> inclusion_time event_datetime #> #> 1 12:38:49 NA #> 2 10:38:57 NA #> 3 NA NA #> 4 NA 2024-01-18 12:49:42 #> 5 12:01:07 NA #> 6 NA NA #> #> $is.datetime #> # A tibble: 6 × 1 #> event_datetime #> #> 1 NA #> 2 NA #> 3 NA #> 4 2024-01-18 12:49:42 #> 5 NA #> 6 NA #> #> $is.time_only #> # A tibble: 6 × 1 #> inclusion_time #> #> 1 12:38:49 #> 2 10:38:57 #> 3 NA #> 4 NA #> 5 12:01:07 #> 6 NA #>"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/haven_all_levels.html","id":null,"dir":"Reference","previous_headings":"","what":"Finish incomplete haven attributes substituting missings with values — haven_all_levels","title":"Finish incomplete haven attributes substituting missings with values — haven_all_levels","text":"Finish incomplete haven attributes substituting missings values","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/haven_all_levels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Finish incomplete haven attributes substituting missings with values — haven_all_levels","text":"","code":"haven_all_levels(data)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/haven_all_levels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Finish incomplete haven attributes substituting missings with values — haven_all_levels","text":"data haven labelled variable","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/haven_all_levels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Finish incomplete haven attributes substituting missings with values — haven_all_levels","text":"named vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/haven_all_levels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Finish incomplete haven attributes substituting missings with values — haven_all_levels","text":"","code":"ds <- structure(c(1, 2, 3, 2, 10, 9), labels = c(Unknown = 9, Refused = 10), class = \"haven_labelled\" ) haven::is.labelled(ds) #> [1] TRUE attributes(ds) #> $labels #> Unknown Refused #> 9 10 #> #> $class #> [1] \"haven_labelled\" #> ds |> haven_all_levels() #> 1 2 3 Unknown Refused #> 1 2 3 9 10"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/hms2character.html","id":null,"dir":"Reference","previous_headings":"","what":"Change ","title":"Change ","text":"Change \"hms\" \"character\" REDCap upload.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/hms2character.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change ","text":"","code":"hms2character(data)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/hms2character.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change ","text":"data data set","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/hms2character.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Change ","text":"data.frame tibble","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/hms2character.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Change ","text":"","code":"data <- redcapcast_data ## data |> time_only_correction() |> hms2character()"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/html_tag_wrap.html","id":null,"dir":"Reference","previous_headings":"","what":"Simple html tag wrapping for REDCap text formatting — html_tag_wrap","title":"Simple html tag wrapping for REDCap text formatting — html_tag_wrap","text":"Simple html tag wrapping REDCap text formatting","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/html_tag_wrap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simple html tag wrapping for REDCap text formatting — html_tag_wrap","text":"","code":"html_tag_wrap(data, tag = \"h2\", extra = NULL)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/html_tag_wrap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simple html tag wrapping for REDCap text formatting — html_tag_wrap","text":"data character vector tag character vector length 1 extra character vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/html_tag_wrap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simple html tag wrapping for REDCap text formatting — html_tag_wrap","text":"character vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/html_tag_wrap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Simple html tag wrapping for REDCap text formatting — html_tag_wrap","text":"","code":"html_tag_wrap(\"Titel\", tag = \"div\", extra = 'class=\"rich-text-field-label\"') #> Titel<\/div> html_tag_wrap(\"Titel\", tag = \"h2\") #>
Titel<\/h2>"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/is_missing.html","id":null,"dir":"Reference","previous_headings":"","what":"Multi missing check — is_missing","title":"Multi missing check — is_missing","text":"Multi missing check","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/is_missing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multi missing check — is_missing","text":"","code":"is_missing(data, nas = c(\"\", \"NA\"))"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/is_missing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multi missing check — is_missing","text":"data character vector nas character vector strings considered NA","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/is_missing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multi missing check — is_missing","text":"logical vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/is_repeated_longitudinal.html","id":null,"dir":"Reference","previous_headings":"","what":"Test if repeatable or longitudinal — is_repeated_longitudinal","title":"Test if repeatable or longitudinal — is_repeated_longitudinal","text":"Test repeatable longitudinal","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/is_repeated_longitudinal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test if repeatable or longitudinal — is_repeated_longitudinal","text":"","code":"is_repeated_longitudinal( data, generics = c(\"redcap_event_name\", \"redcap_repeat_instrument\", \"redcap_repeat_instance\") )"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/is_repeated_longitudinal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Test if repeatable or longitudinal — is_repeated_longitudinal","text":"data data set generics default \"redcap_event_name\", \"redcap_repeat_instrument\" \"redcap_repeat_instance\"","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/is_repeated_longitudinal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Test if repeatable or longitudinal — is_repeated_longitudinal","text":"logical","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/is_repeated_longitudinal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Test if repeatable or longitudinal — is_repeated_longitudinal","text":"","code":"is_repeated_longitudinal(c(\"record_id\", \"age\", \"record_id\", \"gender\")) #> [1] FALSE is_repeated_longitudinal(redcapcast_data) #> [1] TRUE is_repeated_longitudinal(list(redcapcast_data)) #> [1] TRUE"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/mark_complete.html","id":null,"dir":"Reference","previous_headings":"","what":"Completion marking based on completed upload — mark_complete","title":"Completion marking based on completed upload — mark_complete","text":"Completion marking based completed upload","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/mark_complete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Completion marking based on completed upload — mark_complete","text":"","code":"mark_complete(upload, ls)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/mark_complete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Completion marking based on completed upload — mark_complete","text":"upload output list `REDCapR::redcap_write()` ls output list `ds2dd_detailed()`","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/mark_complete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Completion marking based on completed upload — mark_complete","text":"list `REDCapR::redcap_write()` results","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/match_fields_to_form.html","id":null,"dir":"Reference","previous_headings":"","what":"Match fields to forms — match_fields_to_form","title":"Match fields to forms — match_fields_to_form","text":"Match fields forms","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/match_fields_to_form.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Match fields to forms — match_fields_to_form","text":"","code":"match_fields_to_form(metadata, vars_in_data)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/match_fields_to_form.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Match fields to forms — match_fields_to_form","text":"metadata data frame containing field names form names vars_in_data character vector variable names","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/match_fields_to_form.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Match fields to forms — match_fields_to_form","text":"data frame containing field names form names","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/mtcars_redcap.html","id":null,"dir":"Reference","previous_headings":"","what":"mtcars dataset slightly modified to use for Shiny app upload demonstration — mtcars_redcap","title":"mtcars dataset slightly modified to use for Shiny app upload demonstration — mtcars_redcap","text":"mtcars dataset slightly modified use Shiny app upload demonstration","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/mtcars_redcap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"mtcars dataset slightly modified to use for Shiny app upload demonstration — mtcars_redcap","text":"","code":"data(mtcars_redcap)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/mtcars_redcap.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"mtcars dataset slightly modified to use for Shiny app upload demonstration — mtcars_redcap","text":"data frame 13 variables: record_id ID, numeric mpg ID, numeric cyl ID, numeric disp ID, numeric hp ID, numeric drat ID, numeric wt ID, numeric qsec ID, numeric vs ID, numeric ID, numeric gear ID, numeric carb ID, numeric name original rownames, charater","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/numchar2fct.html","id":null,"dir":"Reference","previous_headings":"","what":"Applying var2fct across data set — numchar2fct","title":"Applying var2fct across data set — numchar2fct","text":"Individual thresholds character numeric columns","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/numchar2fct.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Applying var2fct across data set — numchar2fct","text":"","code":"numchar2fct(data, numeric.threshold = 6, character.throshold = 6)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/numchar2fct.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Applying var2fct across data set — numchar2fct","text":"data dataset. data.frame tibble numeric.threshold threshold var2fct numeric columns. Default 6. character.throshold threshold var2fct character columns. Default 6.","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/numchar2fct.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Applying var2fct across data set — numchar2fct","text":"data.frame tibble","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/numchar2fct.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Applying var2fct across data set — numchar2fct","text":"","code":"mtcars |> str() #> 'data.frame':\t32 obs. of 11 variables: #> $ mpg : num 21 21 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 ... #> $ cyl : num 6 6 4 6 8 6 8 4 4 6 ... #> $ disp: num 160 160 108 258 360 ... #> $ hp : num 110 110 93 110 175 105 245 62 95 123 ... #> $ drat: num 3.9 3.9 3.85 3.08 3.15 2.76 3.21 3.69 3.92 3.92 ... #> $ wt : num 2.62 2.88 2.32 3.21 3.44 ... #> $ qsec: num 16.5 17 18.6 19.4 17 ... #> $ vs : num 0 0 1 1 0 1 0 1 1 1 ... #> $ am : num 1 1 1 0 0 0 0 0 0 0 ... #> $ gear: num 4 4 4 3 3 3 3 4 4 4 ... #> $ carb: num 4 4 1 1 2 1 4 2 2 4 ... mtcars |> numchar2fct(numeric.threshold = 6) |> str() #> 'data.frame':\t32 obs. of 11 variables: #> $ mpg : num 21 21 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 ... #> $ cyl : Factor w/ 3 levels \"4\",\"6\",\"8\": 2 2 1 2 3 2 3 1 1 2 ... #> $ disp: num 160 160 108 258 360 ... #> $ hp : num 110 110 93 110 175 105 245 62 95 123 ... #> $ drat: num 3.9 3.9 3.85 3.08 3.15 2.76 3.21 3.69 3.92 3.92 ... #> $ wt : num 2.62 2.88 2.32 3.21 3.44 ... #> $ qsec: num 16.5 17 18.6 19.4 17 ... #> $ vs : Factor w/ 2 levels \"0\",\"1\": 1 1 2 2 1 2 1 2 2 2 ... #> $ am : Factor w/ 2 levels \"0\",\"1\": 2 2 2 1 1 1 1 1 1 1 ... #> $ gear: Factor w/ 3 levels \"3\",\"4\",\"5\": 2 2 2 1 1 1 1 2 2 2 ... #> $ carb: Factor w/ 6 levels \"1\",\"2\",\"3\",\"4\",..: 4 4 1 1 2 1 4 2 2 4 ..."},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/parse_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper to auto-parse un-formatted data with haven and readr — parse_data","title":"Helper to auto-parse un-formatted data with haven and readr — parse_data","text":"Helper auto-parse un-formatted data haven readr","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/parse_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper to auto-parse un-formatted data with haven and readr — parse_data","text":"","code":"parse_data( data, guess_type = TRUE, col_types = NULL, locale = readr::default_locale(), ignore.vars = \"cpr\", ... )"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/parse_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper to auto-parse un-formatted data with haven and readr — parse_data","text":"data data.frame tibble guess_type logical guess type readr col_types specify col_types using readr semantics. Ignored guess_type TRUE locale option specify locale. Defaults readr::default_locale(). ignore.vars specify column names columns ignore parsing ... ignored","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/parse_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper to auto-parse un-formatted data with haven and readr — parse_data","text":"data.frame tibble","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/parse_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Helper to auto-parse un-formatted data with haven and readr — parse_data","text":"","code":"mtcars |> parse_data() |> str() #> 'data.frame':\t32 obs. of 11 variables: #> $ mpg : num 21 21 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 ... #> $ cyl : num 6 6 4 6 8 6 8 4 4 6 ... #> $ disp: num 160 160 108 258 360 ... #> $ hp : num 110 110 93 110 175 105 245 62 95 123 ... #> $ drat: num 3.9 3.9 3.85 3.08 3.15 2.76 3.21 3.69 3.92 3.92 ... #> $ wt : num 2.62 2.88 2.32 3.21 3.44 ... #> $ qsec: num 16.5 17 18.6 19.4 17 ... #> $ vs : num 0 0 1 1 0 1 0 1 1 1 ... #> $ am : num 1 1 1 0 0 0 0 0 0 0 ... #> $ gear: num 4 4 4 3 3 3 3 4 4 4 ... #> $ carb: num 4 4 1 1 2 1 4 2 2 4 ..."},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.character.html","id":null,"dir":"Reference","previous_headings":"","what":"User input processing character — process_user_input.character","title":"User input processing character — process_user_input.character","text":"User input processing character","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.character.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"User input processing character — process_user_input.character","text":"","code":"# S3 method for class 'character' process_user_input(x, ...)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.character.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"User input processing character — process_user_input.character","text":"x input ... ignored","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.character.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"User input processing character — process_user_input.character","text":"processed input","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.data.frame.html","id":null,"dir":"Reference","previous_headings":"","what":"User input processing data.frame — process_user_input.data.frame","title":"User input processing data.frame — process_user_input.data.frame","text":"User input processing data.frame","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.data.frame.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"User input processing data.frame — process_user_input.data.frame","text":"","code":"# S3 method for class 'data.frame' process_user_input(x, ...)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.data.frame.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"User input processing data.frame — process_user_input.data.frame","text":"x input ... ignored","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.data.frame.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"User input processing data.frame — process_user_input.data.frame","text":"processed input","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.default.html","id":null,"dir":"Reference","previous_headings":"","what":"User input processing default — process_user_input.default","title":"User input processing default — process_user_input.default","text":"User input processing default","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.default.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"User input processing default — process_user_input.default","text":"","code":"# Default S3 method process_user_input(x, ...)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.default.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"User input processing default — process_user_input.default","text":"x input ... ignored","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.default.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"User input processing default — process_user_input.default","text":"processed input","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.html","id":null,"dir":"Reference","previous_headings":"","what":"User input processing — process_user_input","title":"User input processing — process_user_input","text":"User input processing","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"User input processing — process_user_input","text":"","code":"process_user_input(x)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"User input processing — process_user_input","text":"x input","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"User input processing — process_user_input","text":"processed input","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.response.html","id":null,"dir":"Reference","previous_headings":"","what":"User input processing response — process_user_input.response","title":"User input processing response — process_user_input.response","text":"User input processing response","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.response.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"User input processing response — process_user_input.response","text":"","code":"# S3 method for class 'response' process_user_input(x, ...)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.response.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"User input processing response — process_user_input.response","text":"x input ... ignored","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.response.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"User input processing response — process_user_input.response","text":"processed input","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/read_input.html","id":null,"dir":"Reference","previous_headings":"","what":"Flexible file import based on extension — read_input","title":"Flexible file import based on extension — read_input","text":"Flexible file import based extension","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/read_input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Flexible file import based on extension — read_input","text":"","code":"read_input(file, consider.na = c(\"NA\", \"\\\"\\\"\", \"\"))"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/read_input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Flexible file import based on extension — read_input","text":"file file name consider.na character vector strings consider NAs","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/read_input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Flexible file import based on extension — read_input","text":"tibble","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/read_input.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Flexible file import based on extension — read_input","text":"","code":"read_input(\"https://raw.githubusercontent.com/agdamsbo/cognitive.index.lookup/main/data/sample.csv\") #> Rows: 28 Columns: 8 #> ── Column specification ──────────────────────────────────────────────────────── #> Delimiter: \",\" #> dbl (8): id, ab, age, imm, vis, ver, att, del #> #> ℹ Use `spec()` to retrieve the full column specification for this data. #> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. #> # A tibble: 28 × 8 #> id ab age imm vis ver att del #>