-1

I am performing a mutate_all such as:

nome.serie <- "13corte4"
nome.serie <- mutate_all(nome.serie, funs=toupper)

but I get the following error:

Error in UseMethod("tbl_vars") : 
no applicable method for 'tbl_vars' applied to an object of class "character"

I have tried mutate_each and mutate_at as well. I have also tried this function:

upper_it = function(X){X %>% mutate_each_( funs(as.character(.)), names( . 
[sapply(., is.factor)] )) %>%
mutate_each_( funs(toupper), names( .[sapply(., is.character)] ))}

However the same error happens again and again

1 Answers1

0

Try

nome.serie <- "13corte4"
DF <- data.frame(nome.serie = nome.serie)
DF <- mutate_all(DF, .funs=toupper)
DF
#  nome.serie
#1   13CORTE4

The error message states that the first argument in mutate_all should not be a character vector.

markus
  • 25,843
  • 5
  • 39
  • 58