To convert a string to lowercase in R, you can use the tolower()
function.
In this example,
str
with the value "Hello World"
.tolower()
with str
as argument and store the result in a new variable lowercaseStr
.lowercaseStr
.str <- 'Hello World'
lowercaseStr <- tolower(str)
print(lowercaseStr)
hello world
In this example,
str
with the value "R Programming"
.tolower()
with str
as argument and store the result in a new variable lowercaseStr
.lowercaseStr
.str <- 'R Programming'
lowercaseStr <- tolower(str)
print(lowercaseStr)
r programming
In this tutorial, we learned How to convert String to Lowercase in R language with well detailed examples.