Skip to content

Commit 8c7abd0

Browse files
committed
fix for add_bars() and example
1 parent 1d5e045 commit 8c7abd0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

R/add.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ add_area <- function(p, x = NULL, ymax = NULL, ...) {
274274
add_bars <- function(p, x = NULL, y = NULL, ...) {
275275
x <- x %||% p$x$attrs[[1]][["x"]]
276276
y <- y %||% p$x$attrs[[1]][["y"]]
277-
if (is.null(x) && is.null(y)) {
278-
stop("Must supply `x` and/or `y` attributes", call. = FALSE)
277+
if (is.null(x) || is.null(y)) {
278+
stop("Must supply `x` and `y` attributes", call. = FALSE)
279279
}
280280
# TODO: provide type checking in plotly_build for this trace type
281281
add_trace_classed(

R/plotly_POST.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#' @author Carson Sievert
3232
#' @examples
3333
#' \dontrun{
34-
#' p <- plot_ly(mtcars, x = vs, type = "bar")
34+
#' p <- plot_ly(mtcars, x = ~factor(vs))
3535
#' plotly_POST(p, filename = "mtcars-bar-plot")
3636
#' }
3737

man/plotly_POST.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)