Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

r
communitycreator

How to convert a string to lowercase in R

harris910

The tolower() function in R converts a string to lowercase.

The following figure shows a visual representation of the tolower() function.

Visual representation of tolower() function

Syntax

tolower(string)

Parameter

As a parameter, the tolower() function requires a string which is to be converted to lowercase.

Return value

The tolower() function returns a string that is converted to lowercase.

Code

The code below shows how the tolower() function works in R.

#String
a <- tolower("EDUCATIVE");
print(paste0("tolower('EDUCATIVE'): ", a))

#String with number
b <- tolower("EDUCATIVE09");
print(paste0("tolower('EDUCATIVE09'): ", b))

RELATED TAGS

r
communitycreator
RELATED COURSES

View all Courses

Keep Exploring