1
votes

I have got a shiny application where I use the plotly package to convert my ggplot graph into dynamics graphics. I am at the moment facing a problem with this conversion.

Here is my data.frame :

b <- data.frame(ID_Miseq = c(rep("P1",8), rep("P2",8), rep("P3",8), rep("P4",8)),
Condition1 = c(rep("A", 8), rep("B",16), rep("C", 8)),
Taxon = c(rep(paste0("T",1:8),4)),
Percent = sample(seq(1,25,0.1),32))

When I am creating my static barplot, no problem.

library(ggplot2)
gg <- ggplot(b, aes(x = ID_Miseq, y = Percent, fill = Taxon))
gg <- gg + geom_bar(stat = "identity", position = "stack")
factors <- "~Condition1"
gg <- gg + facet_grid(factors, scales = "free", space = "free_x")
gg

Output from ggplot2

But, when I am using the ggplotly function from the plotly package, one of the sample is turning into numeric scale.

library(plotly)
ggplotly(gg)

enter image description here

Does anyone have ever faced the same kind of issue ? Am I using the ggplotly function wrong ? I am using plotly 4.7.1

1
This problem has been already reported on SO: stackoverflow.com/questions/45660991/…Marco Sandri

1 Answers

1
votes

Thanks, this is now fixed in the dev version, https://github.com/ropensci/plotly/commit/a0fc9c93e3b64ef4545b3522abbdfe44dc0e81a3

Install the dev version with devtools::install_github("ropensci/plotly")