You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to parse_number using mutate for Especie factor for plotting purposes. I've tried the following:
ds.new <- ds %>% mutate(x_1=readr::parse_number(Especie),group = Especie)
summary(ds.new$x_1)
# Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
# NA NA NA NaN NA NA 105
I don't know why it's not working and I've just NA. Please, any ideas?
The text was updated successfully, but these errors were encountered:
That function is for extracting numbers stored as characters, e.g. turning "45" into the integer 45. It looks like Especie doesn't have any numbers in it, and additionally isn't a factor, but a character vector. It sounds like you want the underlying integer codes from a factor. If so, you could explicitly coerce it to a factor (as.factor()) and then integer (as.integer()), i.e. mutate(x_1 = as.integer(as.factor(Especie))).
Hi Everyone!
I'd like to
parse_number
usingmutate
forEspecie
factor for plotting purposes. I've tried the following:I don't know why it's not working and I've just NA. Please, any ideas?
The text was updated successfully, but these errors were encountered: