I thought I had so much plotly experience gained in many hours of coding up shiny apps by now that I knew what I was doing,... but I'm stumped by this seemingly bizarre warning.
Can't display both discrete and non-discrete data on same axis
I still get a visually correct output, and warnings can be suppressed, but I'd like to understand the warning, and avoid raising it, in the first place.
I provide a simple reprex to duplicate my issue.
The warning triggers, when either
p2are called/executed on the console triggering the plot activity.
Can anyone shed some light on this ?
I don't know which axis its complaining about, the x or the y, in in either case, I have discrete factors on x, which I didnt think was ambigious. similarly y has integer 1,2,3 , so no crazy things going on here. not intentionally way.
please save my brain
library(plotly) library(tidyverse) smrypre <- tibble( x=c("a","b","c"), y = c(1,2,3) ) smry<-smrypre smry$x<-factor(x=smry$x, levels = c("a","b","c")) basep <- plot_ly( width = 600, height = 600, type = "bar" ) p <- add_trace(basep, data=smry,name="tried with trace",x=~x, y=~y) #Can't display both discrete & non-discrete data on same axis p2 <- add_bars(basep, data=smry,name="tried with bars",x=~x, y=~y) #Can't display both discrete & non-discrete data on same axis
Created on 2019-11-15 by the reprex package (v0.3.0)