From b0069aa7ae30a8880b2d6a1aad2025b19b069c9d Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Fri, 3 May 2024 15:06:17 -0400 Subject: [PATCH] Upgraded malformed logical message to warning --- R/ability_scores.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/ability_scores.R b/R/ability_scores.R index 7c0a581..767c69d 100644 --- a/R/ability_scores.R +++ b/R/ability_scores.R @@ -16,7 +16,8 @@ ability_singular <- function(method = "4d6"){ if(method == "d20"){method <- "1d20"} # Error out if method isn't specified - if(!method %in% c("4d6", "3d6", "1d20")) stop("`method` not recognized. Select one of '4d6', '3d6', '1d20', or 'd20'") + if(!method %in% c("4d6", "3d6", "1d20")) + stop("'method' not recognized. Select one of '4d6', '3d6', '1d20', or 'd20'") # Roll appropriate number of dice if(method == "4d6"){ for(i in 1:4){ blank[i]<- d6() } } @@ -57,14 +58,13 @@ ability_scores <- function(method = "4d6", quiet = FALSE){ # Error out if method is not part of accepted list if(!method %in% c("4d6", "3d6", "1d20", "d20")) - stop("`method` not recognized, must be one of '4d6', '3d6', '1d20', or 'd20'") + stop("'method' not recognized, must be one of '4d6', '3d6', '1d20', or 'd20'") # Warn if quiet isn't logical if(is.logical(quiet) != TRUE){ - message("`quiet` must be a logical. Defaulting to FALSE") + warning("'quiet' must be a logical. Defaulting to FALSE") quiet <- FALSE } - # Increase specificity of "d20" if someone enters that if(method == "d20"){method <- "1d20"}