From 32b39b997b9898ddf6a4a12b1ca5177a79ee6896 Mon Sep 17 00:00:00 2001 From: evadykaar Date: Mon, 13 May 2024 13:57:59 -0700 Subject: [PATCH 1/2] Fixed extra messages in give_candygrams.R --- R/give_candygrams.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/R/give_candygrams.R b/R/give_candygrams.R index 8d71397..aa7a690 100644 --- a/R/give_candygrams.R +++ b/R/give_candygrams.R @@ -12,10 +12,12 @@ #' @export give_candygrams <- function(person, number, extra_message = NULL) { + library(stringr) + library(english) stopifnot(number > 0) - if (str_detect(person, "Gretchen")) { + if (stringr::str_detect(person, "Gretchen")) { return(cat("None for Gretchen Weiners.")) @@ -30,8 +32,7 @@ give_candygrams <- function(person, number, number <- str_to_title(as.english(number)) - glue::glue("{number} for {person}.") - + glue::glue("{number} for {person}. {extra_message}") } @@ -61,3 +62,4 @@ add_commentary <- function(person, number) { return("") } + From f4701d2a79c35a62548fff656e330dc3f66ec865 Mon Sep 17 00:00:00 2001 From: evadykaar Date: Mon, 13 May 2024 14:27:50 -0700 Subject: [PATCH 2/2] Fixed output faliures --- R/compliments.R | 4 ++-- R/give_candygrams.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/compliments.R b/R/compliments.R index e0066f2..bffdae0 100644 --- a/R/compliments.R +++ b/R/compliments.R @@ -7,9 +7,9 @@ #' @return A compliment string #' #' @export -really_pretty <- function(name, follow_up = TRUE) { +really_pretty <- function(name, follow_up = FALSE) { - compliment <- glue::glue("You're, like, really pretty, {name}.") + compliment <- glue::glue("You're, like, really pretty {name}.") if (follow_up) { compliment <- paste(compliment, diff --git a/R/give_candygrams.R b/R/give_candygrams.R index aa7a690..c1a5ace 100644 --- a/R/give_candygrams.R +++ b/R/give_candygrams.R @@ -32,7 +32,7 @@ give_candygrams <- function(person, number, number <- str_to_title(as.english(number)) - glue::glue("{number} for {person}. {extra_message}") + glue::glue("{number} for {person}.{extra_message}") }