Skip to content

Commit 9527a9e

Browse files
committed
Return NULL if dplyr::group_vars() errors
1 parent 033d56e commit 9527a9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/plotly_build.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ plotly_build.plotly <- function(p, registerFrames = TRUE) {
144144
}
145145

146146
# if appropriate, tack on a group index
147-
grps <- if (has_group(trace)) dplyr::group_vars(dat)
147+
grps <- if (has_group(trace)) tryNULL(dplyr::group_vars(dat))
148148
if (length(grps) && any(lengths(trace) == NROW(dat))) {
149149
trace[[".plotlyGroupIndex"]] <- interaction(dat[, grps, drop = F])
150150
}

0 commit comments

Comments
 (0)