Skip to content

plotluck.multi()is not robust against variables starting with a digit #7

Description

@Christophe-Regouby

Current behavior

Depending of the variable name characters, plotluck() may wrongly fail with unexpected_input error. Variable name starting with a digit will make plotluck fails with

Error in parse(text = call.str) : <text>:1:932: unexpected input
1: ),axis.text.y=element_blank(),strip.background=element_blank(),strip.text=element_blank(),panel.grid.major=element_blank(),panel.grid.minor=element_blank(),axis.title.x=element_text(size=rel(0```


# Expected behavior
Allow variable names starting with a digit

# ReprEx
``` r
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(`1_year` = "year")
plotluck(gapminder, .~1)
#> Error in parse(text = call.str): <text>:1:932: unexpected input
#> 1: ),axis.text.y=element_blank(),strip.background=element_blank(),strip.text=element_blank(),panel.grid.major=element_blank(),panel.grid.minor=element_blank(),axis.title.x=element_text(size=rel(0
#> 

Created on 2025-01-29 with reprex v2.1.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions