Skip to content

bad theme error message #3117

Closed
Closed
@topepo

Description

@topepo

We issue a clear warning below but new users may not understand the severity. A better error message when rendering the plot would be an improvement

library(ggplot2)

# missing ()
theme_set(theme_bw)
#> Warning: New theme missing the following elements: line,
#> rect, text, axis.title.x, axis.title.x.top, axis.title.y,
#> axis.title.y.right, axis.text, axis.text.x, axis.text.x.top,
#> axis.text.y, axis.text.y.right, axis.ticks, axis.ticks.length,
#> axis.line, axis.line.x, axis.line.y, legend.background, legend.margin,
#> legend.spacing, legend.spacing.x, legend.spacing.y, legend.key,
#> legend.key.size, legend.key.height, legend.key.width, legend.text,
#> legend.text.align, legend.title, legend.title.align, legend.position,
#> legend.direction, legend.justification, legend.box, legend.box.margin,
#> legend.box.background, legend.box.spacing, panel.background,
#> panel.border, panel.spacing, panel.spacing.x, panel.spacing.y,
#> panel.grid, panel.grid.minor, panel.ontop, plot.background, plot.title,
#> plot.subtitle, plot.caption, plot.tag, plot.tag.position, plot.margin,
#> strip.background, strip.placement, strip.text, strip.text.x, strip.text.y,
#> strip.switch.pad.grid, strip.switch.pad.wrap

ggplot(mtcars)
#> Error in y[setdiff(names(y), names(x))]: object of type 'closure' is not subsettable

Created on 2019-02-06 by the reprex
package
(v0.2.0).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions