Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ importFrom(dplyr,starts_with)
importFrom(dplyr,summarise_all)
importFrom(janitor,adorn_pct_formatting)
importFrom(janitor,tabyl)
importFrom(labelVector,get_label)
importFrom(labelVector,is_labelled)
importFrom(labelVector,set_label)
importFrom(lifecycle,deprecate_soft)
Expand Down
7 changes: 6 additions & 1 deletion R/make_choose_all_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@
#' @param data The name of the data set
#' @param aVariable The name of the variable
#' @importFrom stringr str_sub str_locate
#' @importFrom labelVector get_label
#' @return A variable's response label without the repeated text from of a
#' _choose all that apply_ question
#'
#' @noRd
#'
## @examples
getLabel2 <- function(data, aVariable) {

#browser()
# pull the variable out and into a data frame
variable <- {{ data }}[aVariable]

# grab the label attribute off the variable inside of the DF
theLab <- dropTags(attributes(variable[, aVariable])$label)
#theLab <- dropTags(attributes(variable[, aVariable])$label)
theLab <- dropTags(labelVector::get_label(variable[, aVariable]))


# check for the delimiters to mark the label for the answer
# the manual export uses = or from the api uses :
Expand Down