string transformation in R

3

I would like to know if I can make a remark about a string variable in upper case.

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" 
    
asked by anonymous 15.01.2018 / 12:50

1 answer

5
x <- c("Casa Branca", "Barco Azul", "Casa Preta")
toupper(x)
[1] "CASA BRANCA" "BARCO AZUL"   "CASA PRETA"
    
15.01.2018 / 13:00