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
It's final writeup season! For whatever reason, about 10 of my students have run into this issue this semester, which I had never noticed before. In ggformula graphics, backticks don't seem to work in variable names. As a reprex, consider:
mtcars <- rename(mtcars, `number of cylinders` = cyl)
If I do things like
lm(mpg~`number of cylinders`, data = mtcars)
mosaic::favstats(`number of cylinders`~vs, data = mtcars)
that all works. But if I try,
> gf_boxplot(`number of cylinders`~vs, data = mtcars)
Error in parse(text = elt) : <text>:1:8: unexpected symbol
1: number of
^
I thought it was only happening on one side of the formula, but it's both
> gf_point(mpg~`number of cylinders`, data = mtcars)
Error in parse(text = elt) : <text>:1:8: unexpected symbol
1: number of
^
If there's another way to specify variables with spaces in them for ggformula, please let me know!
The text was updated successfully, but these errors were encountered:
This is a duplicate of #152. You can use the github version for now or wait for the next CRAN release (soon, now that grades are in for the term) to get the fix.
In the meantime, a workaround is to using rename() or mutate() to create syntactic names. (But that only works if your students know that sort of recoding.)
This was a long-standing known issue that I'm glad to have finally fixed. Sorry it got your students at the end of the term. If you or your students install from github, let me know if you encounter an edge cases that don't work.
It's final writeup season! For whatever reason, about 10 of my students have run into this issue this semester, which I had never noticed before. In
ggformula
graphics, backticks don't seem to work in variable names. As a reprex, consider:If I do things like
that all works. But if I try,
I thought it was only happening on one side of the formula, but it's both
If there's another way to specify variables with spaces in them for
ggformula
, please let me know!The text was updated successfully, but these errors were encountered: