[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 #> #> attr(,\"class\") #> [1] \"REDCapCAST\" \"list\" # 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":"if (FALSE) { # \\dontrun{ data <- REDCapCAST::redcapcast_data data |> ds2dd_detailed() iris |> ds2dd_detailed(add.auto.id = TRUE) iris |> ds2dd_detailed( add.auto.id = TRUE, form.name = sample(c(\"b\", \"c\"), size = 6, replace = TRUE, prob = rep(.5, 2)) ) |> purrr::pluck(\"meta\") mtcars |> ds2dd_detailed(add.auto.id = TRUE) data <- iris |> ds2dd_detailed(add.auto.id = TRUE) |> 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 |> ds2dd_detailed(form.sep = \"__\") } # }"},{"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/fct2num.html","id":null,"dir":"Reference","previous_headings":"","what":"Allows conversion of factor to numeric values preserving original levels — fct2num","title":"Allows conversion of factor to numeric values preserving original levels — fct2num","text":"Allows conversion factor numeric values preserving original levels","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/fct2num.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Allows conversion of factor to numeric values preserving original levels — fct2num","text":"","code":"fct2num(data)"},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/fct2num.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Allows conversion of factor to numeric values preserving original levels — fct2num","text":"data vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/fct2num.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Allows conversion of factor to numeric values preserving original levels — fct2num","text":"numeric vector","code":""},{"path":"https://agdamsbo.github.io/REDCapCAST/reference/fct2num.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Allows conversion of factor to numeric values preserving original levels — fct2num","text":"","code":"c(1, 4, 3, \"A\", 7, 8, 1) |> as_factor() |> fct2num() #> Warning: invalid roman numeral: A #> [1] 1 2 3 4 5 6 1 structure(c(1, 2, 3, 2, 10, 9), labels = c(Unknown = 9, Refused = 10), class = \"haven_labelled\" ) |> as_factor() |> fct2num() #> [1] 1 2 3 2 10 9 structure(c(1, 2, 3, 2, 10, 9), labels = c(Unknown = 9, Refused = 10), class = \"labelled\" ) |> as_factor() |> fct2num() #> [1] 1 2 3 2 10 9 # Outlier with labels, but no class of origin, handled like numeric vector # structure(c(1, 2, 3, 2, 10, 9), # labels = c(Unknown = 9, Refused = 10) # ) |> # as_factor() |> # fct2num() v <- sample(6:19,20,TRUE) |> factor() dput(v) #> structure(c(2L, 4L, 7L, 3L, 3L, 6L, 10L, 1L, 11L, 5L, 8L, 11L, #> 8L, 3L, 3L, 9L, 10L, 1L, 4L, 2L), levels = c(\"7\", \"9\", \"10\", #> \"11\", \"12\", \"13\", \"14\", \"16\", \"17\", \"18\", \"19\"), class = \"factor\") named_levels(v) #> 9 11 14 10 13 18 7 19 12 16 17 #> 2 4 7 3 6 10 1 11 5 8 9 fct2num(v) #> [1] 9 11 14 10 10 13 18 7 19 12 16 19 16 10 10 17 18 7 11 9"},{"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\" do.call(c, sapply(mtcars, get_attr)) #> $mpg.label #> [1] \"testing\" #> if (FALSE) { # \\dontrun{ mtcars |> numchar2fct(numeric.threshold = 6) |> ds2dd_detailed() } # }"},{"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 #>