R/capwords.r

#' @export
	
capwords <- function(s, strict = FALSE) {
			  cap <- function(s) paste(toupper(substring(s,1,1)),
         {s <- substring(s,2); if(strict) tolower(s) else s},
              sep = "", collapse = " " )
				  sapply(strsplit(s, split = " "), cap, USE.NAMES = !is.null(names(s)))
					
				}
AMCOOK/FoodHabits documentation built on May 5, 2019, 11:34 a.m.