R/ls_process_labels.R
ls_process_labels.Rd
This function is meant to quickly parse the variable labels set by LimeSurvey. It works particularly well with dual anchor array questions, where the left and right anchors as well as the subquestions are extracted automatically.
ls_process_labels(
data,
varnameRegExPairs = NULL,
lengthToWrap = 50,
lengthToWrapAnchors = 20,
labelExtractionRegExPair = limonaid::opts$get("labelExtractionRegExPair"),
leftAnchorRegExPairs = limonaid::opts$get("leftAnchorRegExPairs"),
rightAnchorRegExPairs = limonaid::opts$get("rightAnchorRegExPairs")
)
The dataframe as produced by ls_import_data()
.
Pairs of regular expressions to replace in the variable names. This is useful when some pattern can be applied to the variable names to, for example, add underscores te denote different parts of the variable name. This has to be a list of character vectors that each have length 2.
At how many characters to wrap the subquestions.
At how many characters to wrap the anchors.
The regular expression pair used to extract the labels.
The regular expression pairs to use to extract the left anchors.
The regular expression pairs to use to extract the right anchors.
A dataframe.
This function processes LimeSurvey variable labels and applies regular expressions to automatically extract subquestions and left and right anchors.
### No examples provided yet; this would require data to be included,
### and that's not available yet.