Skip to content

Commit ea72de6

Browse files
committed
exists is too fancy
1 parent 4a8c586 commit ea72de6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/legend.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ draw_legend <- function(gsplot) {
7676

7777
default.args <- formals(graphics::legend)
7878

79-
if (exists('legend', gsplot)){
79+
if ("legend" %in% names(gsplot)){
8080

8181
# TODO rather than preserve individual pars we should par-scope this draw_legend call
8282
# and par scope each run of the for loop
@@ -92,7 +92,7 @@ draw_legend <- function(gsplot) {
9292
legend <- appendLegendColumnInfo(legend)
9393
legend <- appendLegendPositionConfiguration(legend)
9494
# set required legend argument to NA if not exists
95-
if (!exists("legend", legend)) {
95+
if (!"legend" %in% names(legend)) {
9696
legend$legend <- NA
9797
}
9898

0 commit comments

Comments
 (0)