fix: correct data loading

This commit is contained in:
2026-04-13 19:30:27 +03:00
parent 4c3d339361
commit 2f62a94afa
8 changed files with 97 additions and 97 deletions

View File

@@ -4,7 +4,8 @@
#' not 'empty').
#'
#' Needed for proper data validation.
check_for_empty_data = function(value_to_check) {
#' @export
is_this_empty_value = function(value_to_check) {
# for any 0-length
if (length(value_to_check) == 0) return(TRUE)
@@ -19,7 +20,14 @@ check_for_empty_data = function(value_to_check) {
if (inherits(value_to_check, "Date") && length(value_to_check) != 0) return(FALSE)
# for empty strings (stands before checking non-empty data for avoid mistakes)
if (value_to_check == "") return(TRUE)
if (is.character(value_to_check)) {
if (is.na(value_to_check)) return(TRUE)
if (value_to_check == "") return(TRUE)
}
FALSE
if (is.double(value_to_check)) {
if (is.na(value_to_check)) return(TRUE)
}
return(FALSE)
}