fix: address review round 3 for #7

This commit is contained in:
2026-07-05 00:56:30 -04:00
parent 0d523c83de
commit 4ea7333835
2 changed files with 8 additions and 6 deletions
+5 -3
View File
@@ -111,7 +111,9 @@ nvals <- function(x){
#' simpleCap(my_string)
simpleCap <- function(x) {
stopifnot(class(x) == "character")
s <- strsplit(x, " ")[[1]]
paste(toupper(substring(s, 1,1)), substring(s, 2),
sep = "", collapse = " ")
sapply(x, function(word) {
s <- strsplit(word, " ")[[1]]
paste(toupper(substring(s, 1, 1)), substring(s, 2),
sep = "", collapse = " ")
})
}