Skip to content

Commit

Permalink
reduce code repetition and adjust formatting of input boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Spinner committed Jan 8, 2025
1 parent 04663bc commit a9e13ce
Show file tree
Hide file tree
Showing 2 changed files with 425 additions and 343 deletions.
12 changes: 6 additions & 6 deletions R/label_operators.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ set_empty_label <- function(x) {
}

#' Get the Label of a Heading
#'
#'
#' This function retrieves the label of a heading from a labels file.
#'
#'
#' @param variable The variable for which the label is to be retrieved.
#'
#'
#' @return The label of the heading if it exists in the labels file,
#' otherwise "No label available".
#'
#'
#' @examples
#' \dontrun{
#' # Example usage:
Expand All @@ -135,12 +135,12 @@ set_empty_label <- function(x) {
#' get_label("USUBJID") # Returns "Unique Subject Identifier"
#' get_label("AGE") # Returns "No label available"
#' }
#'
#'
#' @export
get_label <- function(variable) {
label <- unique(labels_file$Label[labels_file$Variable == variable])
if (length(label) == 0) {
return("No label available")
}
return(label)
}
}
Loading

0 comments on commit a9e13ce

Please sign in to comment.