Handling 0 case for min and max
This commit is contained in:
parent
3fc242b0b2
commit
76e60b3202
1 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue