plotly

Error ggplotly: VECTOR_ELT() can only be applied to a 'list', not a 'NULL'

╄→尐↘猪︶ㄣ 提交于 2019-12-03 06:37:47
I'm using R 3.3.3 and RStudio 1.0.136 , and the latest versions of all the packages. I get this error with the plotly package > ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species) > ggplotly(ggiris) Error in grid.Call(L_convert, x, as.integer(whatfrom), as.integer(whatto), : VECTOR_ELT() can only be applied to a 'list', not a 'NULL' This error does not occur anymore after I "print" the ggplot: > ggiris > ggplotly(ggiris) It occurs not only in RStudio, but also in a Shiny app. Any hint ? Note: This more likely occurs with a "fresh" session (just after opening RStudio). >

Highlight all values from a group on hover

我只是一个虾纸丫 提交于 2019-12-03 05:42:02
问题 Assume data library(ggplot2) library(plotly) set.seed(357) xy <- data.frame(letters = rep(c("a", "b", "c"), times = 3), values = runif(9), groups = rep(c("group1", "group2", "group3"), each = 3)) letters values groups 1 a 0.9913409 group1 2 b 0.6245529 group1 3 c 0.5245744 group1 4 a 0.4601817 group2 5 b 0.2254525 group2 6 c 0.5898001 group2 7 a 0.1716801 group3 8 b 0.3195294 group3 9 c 0.8953055 group3 ggplotly( ggplot(xy, aes(x = letters, y = values, group = groups)) + theme_bw() + geom

Distributed 1.21.8 requires msgpack, which is not installed

我只是一个虾纸丫 提交于 2019-12-03 05:41:36
问题 I'm having a problem trying to install plotly. I proceeded to upgrade anaconda using the command line on Debian 9 and I received the error message "distributed 1.21.0 requires msgpack, which is not installed". Then I tried a conda install mspack , then a pip install --upgade plotly , and I get "distributed 1.22.0 requires msgpack, which is not installed". This 1.22.0 error message is what kicked off my whole upgrading process of many packages. Does this break plotly? Don't know, haven't tried

How to remove option bar from ggplotly plot?

梦想与她 提交于 2019-12-02 23:59:13
I have a plot that I am rendering in shiny using plotly and ggplot2 . However, I do not want the option bar that appears on hover to appear. Is there a way to use ggplotly(p) and remove the option bar? There is a great answer on community plotly the short version: library(plotly) set.seed(100) d <- diamonds[sample(nrow(diamonds), 1000), ] Using ggplotly : p <- ggplot(d, aes(carat, price)) + geom_point() ggplotly(p) %>% config(displayModeBar = F) If you are not using ggplotly you can do: plot_ly(d, x = carat, y = price, text = paste("Clarity: ", clarity), mode = "markers", color = carat, size =

How to plot 3D scatter diagram using ggplot?

巧了我就是萌 提交于 2019-12-02 23:14:42
I tried to use "plotly" function but It is not working in my case at all. "ggplot" is working is in a case of 2D but it is giving an error when adding one more axis. How to solve this issue? ggplot(data,aes(x=D1,y=D2,z=D3,color=Sample))+geom_point() How to add one more axis and get the 3D plot in this? Thank You. Since you tagged your question with plotly and said that you've tried to use it with plotly, I think it would be helpful to give you a working code solution in plotly : Creating some data to plot with: set.seed(417) library(plotly) temp <- rnorm(100, mean=30, sd=5) pressure <- rnorm

Highlight all values from a group on hover

旧街凉风 提交于 2019-12-02 19:01:32
Assume data library(ggplot2) library(plotly) set.seed(357) xy <- data.frame(letters = rep(c("a", "b", "c"), times = 3), values = runif(9), groups = rep(c("group1", "group2", "group3"), each = 3)) letters values groups 1 a 0.9913409 group1 2 b 0.6245529 group1 3 c 0.5245744 group1 4 a 0.4601817 group2 5 b 0.2254525 group2 6 c 0.5898001 group2 7 a 0.1716801 group3 8 b 0.3195294 group3 9 c 0.8953055 group3 ggplotly( ggplot(xy, aes(x = letters, y = values, group = groups)) + theme_bw() + geom_point() ) My goal is to, on hover, highlight all points that belong to the same group. E.g. on hover over

Distributed 1.21.8 requires msgpack, which is not installed

点点圈 提交于 2019-12-02 18:07:43
I'm having a problem trying to install plotly. I proceeded to upgrade anaconda using the command line on Debian 9 and I received the error message "distributed 1.21.0 requires msgpack, which is not installed". Then I tried a conda install mspack , then a pip install --upgade plotly , and I get "distributed 1.22.0 requires msgpack, which is not installed". This 1.22.0 error message is what kicked off my whole upgrading process of many packages. Does this break plotly? Don't know, haven't tried but judging from msgpack website https://msgpack.org/ , it is probable to cause errors. We'll see, I

Creating a dynamic chart displaying sequences of activities with their count in R

假如想象 提交于 2019-12-02 17:04:09
问题 If you run the R script below, the dataset "patients" is an eventlog of patients visiting a clinic and getting treatment. The trace explorer gets created as in the snapshot below with the tooltip displayed. Now in the "#Script for Frequency Percentage", you get the frequency percentage for each trace in the column "af_percent". My requirement is that, I just want to replace the "label = value" in the ggplot command below with corresponding frequency percentage of each trace. Please help.

R Shiny plotly update trace colors with javascript when colourInput is build in the server

与世无争的帅哥 提交于 2019-12-02 15:56:11
问题 This is a modified version to the previous question here In this app (which reflects my real app better) the following situation happens: I have 2 sets of plots, - the 2 plots of a set show the same traces, just different columns plotted - each plot is on a different page in my app - The two plots should be linked to 1 set of colourInputs , on page 2 - The colourInputs are built in the server with renderUI *1 *1: for this reason, I believe that p %>% onRender(js) approach will not work as I

Making a stacked bar plot based on ranges in R and plotly

流过昼夜 提交于 2019-12-02 13:19:03
I want to create a stacked bar chart in R and plotly using iris dataset. In the x-axis, I want to set limits like iris_limits below in the code and the y-axis should contain all the Sepal.Length values which fit into these ranges. I want to pass the values as a single vector. Also, if the limits can be made dynamic by understanding the range of the Sepal.Length instead of hard coding it, please help. I have written a basic script with values to give you an idea. Thanks. library(plotly) iris_limits <- c("1-4", "4-6", "6-8") sepal <- c(2.4,5.4,7.1) data <- data.frame(iris_limits, sepal) p <-