diff --git a/404.html b/404.html index 161cf6a..a296573 100644 --- a/404.html +++ b/404.html @@ -16,7 +16,7 @@ - + Contributor Covenant Code of Conduct • REDCapCASTContributor Covenant Code of Conduct • REDCapCAST @@ -10,7 +10,7 @@ REDCapCAST - 24.4.1 + 24.5.1 + + + + + +
+
+
+ +
+

Mimics case_when for list of regex patterns and values. Used for date/time +validation generation from name vector. Like case_when, the matches are in +order of priority. +Primarily used in REDCapCAST to do data type coding from systematic variable +naming.

+
+ +
+

Usage

+
case_match_regex_list(data, match.list, .default = NA)
+
+ +
+

Arguments

+
data
+

vector

+ + +
match.list
+

list of case matches

+ + +
.default
+

Default value for non-matches. Default is NA.

+ +
+
+

Value

+ + +

vector

+
+ +
+

Examples

+
case_match_regex_list(
+  c("test_date", "test_time", "test_tida", "test_tid"),
+  list(date_dmy = "_dat[eo]$", time_hh_mm_ss = "_ti[md]e?$")
+)
+#> [1] "date_dmy"      "time_hh_mm_ss" NA              "time_hh_mm_ss"
+
+
+
+ + +
+ + + + + + + diff --git a/reference/char2choice.html b/reference/char2choice.html new file mode 100644 index 0000000..85f075d --- /dev/null +++ b/reference/char2choice.html @@ -0,0 +1,116 @@ + +Simple function to generate REDCap choices from character vector — char2choice • REDCapCAST + Skip to contents + + +
+
+
+ +
+

Simple function to generate REDCap choices from character vector

+
+ +
+

Usage

+
char2choice(data, char.split = "/", raw = NULL, .default = NA)
+
+ +
+

Arguments

+
data
+

vector

+ + +
char.split
+

splitting character(s)

+ + +
raw
+

specific values. Can be used for options of same length.

+ + +
.default
+

default value for missing. Default is NA.

+ +
+
+

Value

+ + +

vector

+
+ +
+

Examples

+
char2choice(c("yes/no","  yep. / nope  ","",NA,"what"),.default=NA)
+#> [1] "1, yes | 2, no"    "1, yep. | 2, nope" NA                 
+#> [4] NA                  "1, what"          
+
+
+
+ + +
+ + + + + + + diff --git a/reference/char2cond.html b/reference/char2cond.html new file mode 100644 index 0000000..b40eac9 --- /dev/null +++ b/reference/char2cond.html @@ -0,0 +1,126 @@ + +Simple function to generate REDCap branching logic from character vector — char2cond • REDCapCAST + Skip to contents + + +
+
+
+ +
+

Simple function to generate REDCap branching logic from character vector

+
+ +
+

Usage

+
char2cond(
+  data,
+  minor.split = ",",
+  major.split = ";",
+  major.sep = " or ",
+  .default = NA
+)
+
+ +
+

Arguments

+
data
+

vector

+ + +
minor.split
+

minor split

+ + +
major.split
+

major split

+ + +
major.sep
+

argument separation. Default is " or ".

+ + +
.default
+

default value for missing. Default is NA.

+ +
+
+

Value

+ + +

vector

+
+ +
+

Examples

+
#data <- dd_inst$betingelse
+#c("Extubation_novent, 2; Pacu_delay, 1") |> char2cond()
+
+
+
+
+ + +
+ + + + + + + diff --git a/reference/clean_redcap_name.html b/reference/clean_redcap_name.html index 4bd9b92..5d6e203 100644 --- a/reference/clean_redcap_name.html +++ b/reference/clean_redcap_name.html @@ -1,7 +1,7 @@ clean_redcap_name — clean_redcap_name • REDCapCASTclean_redcap_name — clean_redcap_name • REDCapCASTCreate two-column HTML table for data piping in REDCap instruments — create_html_table • REDCapCAST + Skip to contents + + +
+
+
+ +
+

Create two-column HTML table for data piping in REDCap instruments

+
+ +
+

Usage

+
create_html_table(text, variable)
+
+ +
+

Arguments

+
text
+

descriptive text

+ + +
variable
+

variable to pipe

+ +
+
+

Value

+ + +

character vector

+
+ +
+

Examples

+
create_html_table(text = "Patient ID", variable = c("[cpr]"))
+#> <table style="border-collapse: collapse; width: 100%;" border="0"> <tbody><tr> <td style="width: 58%;"> <h5><span style="font-weight: normal;">Patient ID<br /></span></h5> </td> <td style="width: 42%; text-align: left;"> <h5><span style="font-weight: bold;">[cpr]</span></h5> </td> </tr></tbody> </table>
+create_html_table(text = paste("assessor", 1:2, sep = "_"), variable = c("[cpr]"))
+#> <table style="border-collapse: collapse; width: 100%;" border="0"> <tbody><tr> <td style="width: 58%;"> <h5><span style="font-weight: normal;">assessor_1<br /></span></h5> </td> <td style="width: 42%; text-align: left;"> <h5><span style="font-weight: bold;">[cpr]</span></h5> </td> </tr><tr> <td style="width: 58%;"> <h5><span style="font-weight: normal;">assessor_2<br /></span></h5> </td> <td style="width: 42%; text-align: left;"> <h5><span style="font-weight: bold;">[cpr]</span></h5> </td> </tr></tbody> </table>
+# create_html_table(text = c("CPR nummer","Word"), variable = c("[cpr][1]", "[cpr][2]", "[test]"))
+
+
+
+ + +
+ + + + + + + diff --git a/reference/create_instrument_meta.html b/reference/create_instrument_meta.html index 94f6568..f816689 100644 --- a/reference/create_instrument_meta.html +++ b/reference/create_instrument_meta.html @@ -1,7 +1,7 @@ Create zips file with necessary content based on data set — create_instrument_meta • REDCapCASTCreate zips file with necessary content based on data set — create_instrument_meta • REDCapCASTConvert single digits to words — d2w • REDCapCASTConvert single digits to words — d2w • REDCapCAST @@ -10,7 +10,7 @@ REDCapCAST - 24.4.1 + 24.5.1 + + + + + +
+
+
+ +
+

Works well with `project.aid::docx2list()`. +Allows defining a database in a text document (see provided template) for +an easier to use data base creation. This approach allows easier +collaboration when defining the database. The generic case is a data frame +with variable names as values in a column. This is a format like the REDCap +data dictionary, but gives a few options for formatting.

+
+ +
+

Usage

+
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
+)
+
+ +
+

Arguments

+
data
+

tibble or data.frame with all variable names in one column

+ + +
instrument.name
+

character vector length one. Instrument name.

+ + +
col.variables
+

variable names column (default = 1), allows dplyr +subsetting

+ + +
list.datetime.format
+

formatting for date/time detection. +See `case_match_regex_list()`

+ + +
col.description
+

descriptions column, allows dplyr +subsetting. If empty, variable names will be used.

+ + +
col.condition
+

conditions for branching column, allows dplyr +subsetting. See `char2cond()`.

+ + +
col.subheader
+

sub-header column, allows dplyr subsetting. +See `format_subheader()`.

+ + +
subheader.tag
+

formatting tag. Default is "h2"

+ + +
condition.minor.sep
+

condition split minor. See `char2cond()`. +Default is ",".

+ + +
condition.major.sep
+

condition split major. See `char2cond()`. +Default is ";".

+ + +
col.calculation
+

calculations column. Has to be written exact. +Character vector.

+ + +
col.choices
+

choices column. See `char2choice()`.

+ + +
choices.char.sep
+

choices split. See `char2choice()`. Default is "/".

+ + +
missing.default
+

value for missing fields. Default is NA.

+ +
+
+

Value

+ + +

tibble or data.frame (same as data)

+
+ +
+

Examples

+
# data <- dd_inst
+# data |> doc2dd(instrument.name = "evt",
+# col.description = 3,
+# col.condition = 4,
+# col.subheader = 2,
+# col.calculation = 5,
+# col.choices = 6)
+
+
+
+
+ + +
+ + + + + + + diff --git a/reference/ds2dd.html b/reference/ds2dd.html index 98137dd..68f8b3d 100644 --- a/reference/ds2dd.html +++ b/reference/ds2dd.html @@ -1,6 +1,6 @@ (DEPRECATED) Data set to data dictionary function — ds2dd • REDCapCAST(DEPRECATED) Data set to data dictionary function — ds2dd • REDCapCASTExtract data from stata file for data dictionary — ds2dd_detailed • REDCapCASTExtract data from stata file for data dictionary — ds2dd_detailed • REDCapCAST @@ -10,7 +10,7 @@ REDCapCAST - 24.4.1 + 24.5.1 + + + + + +
+
+
+ +
+

Sub-header formatting wrapper

+
+ +
+

Usage

+
format_subheader(data, tag = "h2")
+
+ +
+

Arguments

+
data
+

character vector

+ + +
tag
+

character vector length 1

+ +
+
+

Value

+ + +

character vector

+
+ +
+

Examples

+
"Instrument header" |> format_subheader()
+#> <div class="rich-text-field-label"><h2>Instrument header</h2></div>
+
+
+
+ + +
+ + + + + + + diff --git a/reference/get_api_key.html b/reference/get_api_key.html index af00b77..dbecdc5 100644 --- a/reference/get_api_key.html +++ b/reference/get_api_key.html @@ -1,5 +1,5 @@ -Retrieve project API key if stored, if not, set and retrieve — get_api_key • REDCapCASTRetrieve project API key if stored, if not, set and retrieve — get_api_key • REDCapCAST @@ -10,7 +10,7 @@ REDCapCAST - 24.4.1 + 24.5.1 + + + + + +
+
+
+ +
+

Simple html tag wrapping for REDCap text formatting

+
+ +
+

Usage

+
html_tag_wrap(data, tag = "h2", extra = NULL)
+
+ +
+

Arguments

+
data
+

character vector

+ + +
tag
+

character vector length 1

+ + +
extra
+

character vector

+ +
+
+

Value

+ + +

character vector

+
+ +
+

Examples

+
html_tag_wrap("Titel", tag = "div", extra = 'class="rich-text-field-label"')
+#> <div class="rich-text-field-label">Titel</div>
+html_tag_wrap("Titel", tag = "h2")
+#> <h2>Titel</h2>
+
+
+
+ + +
+ + + + + + + diff --git a/reference/index.html b/reference/index.html index 788cc30..2a797c9 100644 --- a/reference/index.html +++ b/reference/index.html @@ -1,5 +1,5 @@ -Function reference • REDCapCASTFunction reference • REDCapCAST @@ -10,7 +10,7 @@ REDCapCAST - 24.4.1 + 24.5.1 + + + + + +
+
+
+ +
+

Multi missing check

+
+ +
+

Usage

+
is_missing(data, nas = c("", "NA"))
+
+ +
+

Arguments

+
data
+

character vector

+ + +
nas
+

character vector of strings considered as NA

+ +
+
+

Value

+ + +

logical vector

+
+ +
+ + +
+ + + + + + + diff --git a/reference/is_repeated_longitudinal.html b/reference/is_repeated_longitudinal.html index b8e41c6..2d0ff9f 100644 --- a/reference/is_repeated_longitudinal.html +++ b/reference/is_repeated_longitudinal.html @@ -1,5 +1,5 @@ -Test if repeatable or longitudinal — is_repeated_longitudinal • REDCapCASTTest if repeatable or longitudinal — is_repeated_longitudinal • REDCapCAST @@ -10,7 +10,7 @@ REDCapCAST - 24.4.1 + 24.5.1 + + + + + +
+
+
+ +
+

User input processing character

+
+ +
+

Usage

+
# S3 method for character
+process_user_input(x, ...)
+
+ +
+

Arguments

+
x
+

input

+ + +
...
+

ignored

+ +
+
+

Value

+ + +

processed input

+
+ +
+ + +
+ + + + + + + diff --git a/reference/process_user_input.data.frame.html b/reference/process_user_input.data.frame.html new file mode 100644 index 0000000..d1a887b --- /dev/null +++ b/reference/process_user_input.data.frame.html @@ -0,0 +1,102 @@ + +User input processing data.frame — process_user_input.data.frame • REDCapCAST + Skip to contents + + +
+
+
+ +
+

User input processing data.frame

+
+ +
+

Usage

+
# S3 method for data.frame
+process_user_input(x, ...)
+
+ +
+

Arguments

+
x
+

input

+ + +
...
+

ignored

+ +
+
+

Value

+ + +

processed input

+
+ +
+ + +
+ + + + + + + diff --git a/reference/process_user_input.default.html b/reference/process_user_input.default.html new file mode 100644 index 0000000..afa2f73 --- /dev/null +++ b/reference/process_user_input.default.html @@ -0,0 +1,102 @@ + +User input processing default — process_user_input.default • REDCapCAST + Skip to contents + + +
+
+
+ +
+

User input processing default

+
+ +
+

Usage

+
# S3 method for default
+process_user_input(x, ...)
+
+ +
+

Arguments

+
x
+

input

+ + +
...
+

ignored

+ +
+
+

Value

+ + +

processed input

+
+ +
+ + +
+ + + + + + + diff --git a/reference/process_user_input.html b/reference/process_user_input.html new file mode 100644 index 0000000..a88a7bc --- /dev/null +++ b/reference/process_user_input.html @@ -0,0 +1,97 @@ + +User input processing — process_user_input • REDCapCAST + Skip to contents + + +
+
+
+ +
+

User input processing

+
+ +
+

Usage

+
process_user_input(x)
+
+ +
+

Arguments

+
x
+

input

+ +
+
+

Value

+ + +

processed input

+
+ +
+ + +
+ + + + + + + diff --git a/reference/process_user_input.response.html b/reference/process_user_input.response.html new file mode 100644 index 0000000..56d6145 --- /dev/null +++ b/reference/process_user_input.response.html @@ -0,0 +1,102 @@ + +User input processing response — process_user_input.response • REDCapCAST + Skip to contents + + +
+
+
+ +
+

User input processing response

+
+ +
+

Usage

+
# S3 method for response
+process_user_input(x, ...)
+
+ +
+

Arguments

+
x
+

input

+ + +
...
+

ignored

+ +
+
+

Value

+ + +

processed input

+
+ +
+ + +
+ + + + + + + diff --git a/reference/read_input.html b/reference/read_input.html index 4370e9f..5565480 100644 --- a/reference/read_input.html +++ b/reference/read_input.html @@ -1,5 +1,5 @@ -Flexible file import based on extension — read_input • REDCapCASTFlexible file import based on extension — read_input • REDCapCAST @@ -10,7 +10,7 @@ REDCapCAST - 24.4.1 + 24.5.1