string transformation in R

Asked

Viewed 49 times

3

I wonder if I can turn an observation of a variable, which has a string shape, into uppercase letters.

for example:

#como esta:
x=c("Casa branca","Barco Azul","casa preta")
> x
[1] "Casa branca" "Barco Azul"  "casa preta"
#como ficaria:
[1] "CASA BRANCA" "BARCO AZUL"  "CASA PRETA" 

1 answer

5


x <- c("Casa Branca", "Barco Azul", "Casa Preta")
toupper(x)
[1] "CASA BRANCA" "BARCO AZUL"   "CASA PRETA"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.