-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from IDEMSInternational/updates
updating R packages to 18.10.2024
- Loading branch information
Showing
27 changed files
with
475 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ Imports: | |
magrittr, | ||
methods, | ||
plyr, | ||
pingr, | ||
rlang, | ||
sjlabelled, | ||
stringr, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#' Check for Partial Value Labels | ||
#' | ||
#' @description | ||
#' Checks if the variable contains partial value labels (some values labeled, others not). | ||
#' | ||
#' @param x A variable to check for partial value labels. | ||
#' | ||
#' @return A logical value. Returns `TRUE` if the variable contains partial value labels, otherwise `FALSE`. | ||
#' | ||
#' @examples | ||
#' # Example with partially labeled variable | ||
#' #is.containPartialValueLabel(x) | ||
#' | ||
#' @export | ||
is.containPartialValueLabel <- function(x) { | ||
if (is.containValueLabel(x)) { | ||
levelCounts <- table(x) | ||
return(!all(x[!is.na(x)] %in% attr(x, labels_label)) && | ||
sum(levelCounts == 0) == 0) | ||
} else { | ||
return(FALSE) | ||
} | ||
} |
Oops, something went wrong.