Which of the following function is used for fixing character vectors?

tolower
toUPPER
toLOWER
all of the mentioned

The correct answer is D. all of the mentioned.

The functions tolower(), toUPPER(), and toLOWER() are all used for fixing character vectors.

The function tolower() converts all uppercase letters in a character vector to lowercase letters.

The function toUPPER() converts all lowercase letters in a character vector to uppercase letters.

The function toLOWER() converts all letters in a character vector to lowercase letters, regardless of their case.

For example, the following code shows how to use the function tolower() to convert the character vector “HELLO WORLD” to “hello world”:

“`
library(tidyverse)

df <- data.frame(x = “HELLO WORLD”)

df$x <- tolower(df$x)

print(df)
“`

Output:

x
1 hello world

The following code shows how to use the function toUPPER() to convert the character vector “hello world” to “HELLO WORLD”:

“`
library(tidyverse)

df <- data.frame(x = “hello world”)

df$x <- toupper(df$x)

print(df)
“`

Output:

x
1 HELLO WORLD

The following code shows how to use the function toLOWER() to convert the character vector “HELLO WORLD” to “hello world”:

“`
library(tidyverse)

df <- data.frame(x = “HELLO WORLD”)

df$x <- tolower(df$x)

print(df)