Skip to content

Commit be2d57c

Browse files
committed
convert NULL to NA
1 parent 101f0fe commit be2d57c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

R/ggplotly.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,11 @@ gg2list <- function(p) {
947947
# x/y/etc so that they don't get unboxed when they are of length 1.
948948
# unfortunately, this conflicts when using I() in qplot. For example,
949949
# qplot(1:10, 1:10, size = I(10))
950-
un <- function(x) if (is.list(x)) lapply(x, un) else if (inherits(x, "AsIs")) unclass(x) else x
950+
un <- function(x) {
951+
if (is.null(x)) return(NA)
952+
if (is.list(x)) lapply(x, un)
953+
else if (inherits(x, "AsIs")) unclass(x)
954+
else x
955+
}
951956
lapply(l, un)
952957
}

0 commit comments

Comments
 (0)