toupper()
method in R programming is used to convert the lowercase string to uppercase string.
In R, there are several ways to convert a string from lowercase to uppercase. Here are a few examples:
string <- "hello world" string_upper <- toupper(string) print(string_upper)
Output: "HELLO WORLD"
library(stringr) string <- "hello world" string_upper <- str_to_upper(string) print(string_upper)
Output: "HELLO WORLD"
string <- "hello world" string_upper <- toUpper(string) print(string_upper)
Output: "HELLO WORLD"
All of these methods will result in the same output, which is the original string converted to uppercase.