Current behavior
Depending of the variable name characters, plotluck() may wrongly interpret formula as invalid. a variable name with the minus sign will make plotluck fails with
Error in parse.formula(formula) :
Invalid formula: only one dependent variable allowed
Expected behavior
Allow variable names with - sign
ReprEx
library(plotluck)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(gapminder)
gapminder <- gapminder |> rename(`int-year` = "year")
plotluck(gapminder, .~1)
#> Factor variable country has too many levels (142), truncating to 30
#> Error in parse.formula(formula): Invalid formula: only one dependent variable allowed
Created on 2025-01-29 with reprex v2.1.1
Current behavior
Depending of the variable name characters,
plotluck()may wrongly interpret formula as invalid. a variable name with the minus sign will make plotluck fails withExpected behavior
Allow variable names with
-signReprEx
Created on 2025-01-29 with reprex v2.1.1