1 Matching Annotations
- May 2019
-
jrnold.github.io jrnold.github.io
-
bottles <- function(i) { if (i > 2) { bottles <- str_c(i - 1, " bottles") } else if (i == 2) { bottles <- "1 bottle" } else { bottles <- "no more bottles" } bottles }
I think this should read:
bottles <- function(i) { if (i > 1) { bottles <- str_c(i , " bottles") } else if (i == 1) { bottles <- "1 bottle" } else { bottles <- "no more bottles" } bottles }
Otherwise you get no bottles of beer twice in the final output
-