Learn R Programming

redcapAPI (version 2.8.0)

stripHTMLandUnicode: Helper Functions for exportRecordsType Attributes

Description

These functions assist in setting attributes for columns of the resulting type cast data.frame.

Usage

stripHTMLandUnicode(field_name, field_label, field_annotation)

unitsFieldAnnotation(field_name, field_label, field_annotation)

Value

stripHTMLandUnicode returns a character vector.

unitsFieldAnnotation returns a character vector.

Arguments

field_name

character. Name of the fields.

field_label

character. Labels from meta data.

field_annotation

character. Annotations from meta_data.

Details

Functions passed into the assignment argument list of exportRecordsTyped() construct attributes on a column. They are expected to have a signature of function(field_name, field_label, field_annotation) and return the attribute to assign or NA. They must be vectorized.

Useful utilities are provided in stringCleanup()

stripHTMLandUnicode strips both HTML and UNICODE from the field_label.

unitsFieldAnnotation pulls a units string from the field_annotation. An example of the form searched for is units=\{"meters"\}

See Also

exportRecordsTyped(),
exportReportsTyped(),
stripHTMLTags(),
stripUnicode()

Examples

Run this code
if (FALSE) {
stripHTMLandUnicode("field_name", "Field label", "field annotation")

unitsFieldAnnotation("field", "label", "units={\"meters\"}")
}

Run the code above in your browser using DataLab