fix: correct data loading
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user