Handling 0 case for min and max

This commit is contained in:
Louis 2025-12-22 15:29:50 +01:00
parent 3fc242b0b2
commit 76e60b3202

View file

@ -14,7 +14,7 @@ if (length(args) <= 1) {
max_arg <- args[2]
}
if (identical(max_arg, character(0)) || is.na(as.integer(max_arg))) {
if (identical(max_arg, character(0)) || is.na(as.integer(max_arg)) || as.integer(max_arg) <= 0) {
max_nb_col <- 5000L
print(paste0("No or incorrect argument was passed setting max to default value : ", max_nb_col))
} else {
@ -22,7 +22,7 @@ if (identical(max_arg, character(0)) || is.na(as.integer(max_arg))) {
print(paste0("Setting to max provided value : ", max_nb_col))
}
if (identical(min_arg, character(0)) || is.na(as.integer(min_arg))) {
if (identical(min_arg, character(0)) || is.na(as.integer(min_arg)) || as.integer(min_arg) <= 0) {
min_nb_col <- 50L
print(paste0("No or incorrect argument was passed setting min to default value : ", min_nb_col))
} else {