There is a build-in base-R solution for title case as well:
tools::toTitleCase("demonstrating the title case")
## [1] "Demonstrating the Title Case"
or
library(tools)
toTitleCase("demonstrating the title case")
## [1] "Demonstrating the Title Case"