Last active
July 18, 2025 13:43
-
-
Save pH-7/38e042af2cae518184a1975c2b55e697 to your computer and use it in GitHub Desktop.
R helper functions for strings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Convert text to lowercase. | |
## | |
to_lowercase <- function(input_text) { | |
# Check if input is character | |
if (!is.character(input_text)) { | |
stop("Input must be a character string") | |
} | |
# Convert to lowercase | |
tolower(input_text) | |
} | |
# Usage | |
example_text <- "This is my Sleep Routine Hack: How to Get More Done Without Working Harder" | |
print(to_lowercase(example_text)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.