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
Variables names with rare characters used in french plots are mishandled by make_unit_label
To reproduce
library(tidyverse)
library(units)
# Traceback
options(error=function() traceback(3))
# Variable name with single quote insidea=tibble(`Volume à l'inclusion`= set_units(1:100, mL))
a|>
ggplot(aes(x=`Volume à l'inclusion`)) +
geom_density()
Apparently make_unit_label doesn't remove the quote, only whitespaces, maybe this line should be updated to remove single quotes, double quotes and apostrophes (and maybe other characters, but these definetely produce errors).
@Ralayax Did you test this with ggplot2 only? I see:
library(ggplot2)
data.frame(`Volume à l'inclusion`=1:100) |>
ggplot(aes(x=`Volume à l'inclusion`)) +
geom_density()
#> Error in `geom_density()`:#> ! Problem while computing aesthetics.#> ℹ Error occurred in the 1st layer.#> Caused by error:#> ! object 'Volume à l'inclusion' not found
Variables names with rare characters used in french plots are mishandled by make_unit_label
To reproduce
Apparently make_unit_label doesn't remove the quote, only whitespaces, maybe this line should be updated to remove single quotes, double quotes and apostrophes (and maybe other characters, but these definetely produce errors).
units/R/plot.R
Line 33 in 626a41d
I'm not quite sure what the function exactly does with the lab string so this might be the wrong course of action.
Have a nice day
The text was updated successfully, but these errors were encountered: