We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From Dave Cooper:
# mutate and summarize bugs.R rm(list = ls()) require(plyr) require(ggplot2) d = diamonds ######################### # MUTATE BUG # this works e = mutate(d, cut2 = as.character(cut) ) e = mutate(e, cut2 = ifelse(cut2 == 'Fair', '*Fairest*', cut2)) plyr::count(e, ~cut+cut2) # this fails e = mutate(d, cut2 = as.character(cut), cut2 = ifelse(cut2 == 'Fair', '*Fairest*', cut2)) plyr::count(e, ~cut+cut2) # but this works! e = mutate(d, cut2 = as.character(cut), cut3 = ifelse(cut2 == 'Fair', '*Fairest*', cut2)) plyr::count(e, ~cut+cut2+cut3) ######################### # SAME PROBLEM, BUT WITH SUMMARIZE # this works e = summarize(d, cut2 = as.character(cut) ) e = summarize(e, cut2 = ifelse(cut2 == 'Fair', '*Fairest*', cut2)) count(e, ~cut2) # this fails e = summarize(d, cut2 = as.character(cut), cut2 = ifelse(cut2 == 'Fair', '*Fairest*', cut2)) count(e, ~cut2) # but this works! e = summarize(d, cut2 = as.character(cut), cut3 = ifelse(cut2 == 'Fair', '*Fairest*', cut2)) count(e, ~cut2+cut3) ######################### # MUTATE with REVALUE # this works e = mutate(d, cut2 = revalue(cut, c(Fair = '*Fairest*')) ) e = mutate(e, cut2 = revalue(cut2, c('*Fairest*' = '*Fairest of All*')) ) count(e, ~cut+cut2) # this fails e = mutate(d, cut2 = revalue(cut, c(Good = '*Fairest*')), cut2 = revalue(cut2, c('*Fairest*' = '*Fairest of All*')) ) count(e, ~cut+cut2) # but this works! e = mutate(d, cut2 = revalue(cut, c(Good = '*Fairest*')), cut3 = revalue(cut2, c('*Fairest*' = '*Fairest of All*')) ) count(e, ~cut+cut2+cut3)
The text was updated successfully, but these errors were encountered:
cfae81a
No branches or pull requests
From Dave Cooper:
The text was updated successfully, but these errors were encountered: