Skip to content

Trailing comma in theme() causing error in 3.5.0 #5667

Closed
@kylebutts

Description

@kylebutts

I'm on the most recent commit and trailing comma support in theme() is not working. I'm not sure why since it seems to call list2() which allows for trailing comments? I have traced it back to this PR: #5543

Commit a4be39d produces:

library(ggplot2)
theme(
  title = element_text(size = 12), 
)
#> Error in `list2()`:
#> ! Argument 1 can't be empty.

Commit right before 6df5cd4:

library(ggplot2)
theme(
  title = element_text(size = 12), 
)
#> List of 1
#>  $ title:List of 11
#>   ..$ family       : NULL
#>   ..$ face         : NULL
#>   ..$ colour       : NULL
#>   ..$ size         : num 12
#>   ..$ hjust        : NULL
#>   ..$ vjust        : NULL
#>   ..$ angle        : NULL
#>   ..$ lineheight   : NULL
#>   ..$ margin       : NULL
#>   ..$ debug        : NULL
#>   ..$ inherit.blank: logi FALSE
#>   ..- attr(*, "class")= chr [1:2] "element_text" "element"
#>  - attr(*, "class")= chr [1:2] "theme" "gg"
#>  - attr(*, "complete")= logi FALSE
#>  - attr(*, "validate")= logi TRUE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions