plotly

R Error: First argument, `data`, must be a data frame or shared data

社会主义新天地 提交于 2021-02-20 02:53:52
问题 I am using the R programming language. I am following this tutorial over here: https://plotly.com/r/dropdowns/ I tried to create my own data and run the same procedure: library(plotly) library(MASS) library(dplyr) # create data x <- sample( LETTERS[1:4], 731, replace=TRUE, prob=c(0.25, 0.25, 0.25, 0.25) ) y <- rnorm(731,10,10) z <- rnorm(731,5,5) date= seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") df <- data.frame(x,y, z, date) df$x = as.factor(df$x) #create plot fig <- plot_ly(df, x

R Error: First argument, `data`, must be a data frame or shared data

时光总嘲笑我的痴心妄想 提交于 2021-02-20 02:52:19
问题 I am using the R programming language. I am following this tutorial over here: https://plotly.com/r/dropdowns/ I tried to create my own data and run the same procedure: library(plotly) library(MASS) library(dplyr) # create data x <- sample( LETTERS[1:4], 731, replace=TRUE, prob=c(0.25, 0.25, 0.25, 0.25) ) y <- rnorm(731,10,10) z <- rnorm(731,5,5) date= seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") df <- data.frame(x,y, z, date) df$x = as.factor(df$x) #create plot fig <- plot_ly(df, x

R Error: First argument, `data`, must be a data frame or shared data

一曲冷凌霜 提交于 2021-02-20 02:52:15
问题 I am using the R programming language. I am following this tutorial over here: https://plotly.com/r/dropdowns/ I tried to create my own data and run the same procedure: library(plotly) library(MASS) library(dplyr) # create data x <- sample( LETTERS[1:4], 731, replace=TRUE, prob=c(0.25, 0.25, 0.25, 0.25) ) y <- rnorm(731,10,10) z <- rnorm(731,5,5) date= seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") df <- data.frame(x,y, z, date) df$x = as.factor(df$x) #create plot fig <- plot_ly(df, x

One slider controlling multiple subplots in R

若如初见. 提交于 2021-02-20 02:46:49
问题 I want to use one slider to control multiple subplots created with plotly. I found answers in Python like these two: Plot.ly. Using slider control with multiple plots https://community.plot.ly/t/using-one-slider-to-control-multiple-subplots-not-multiple-traces/13955/4 Example (second link): import plotly.graph_objs as go from plotly.tools import make_subplots fig = make_subplots(1, 2) fig.add_scatter(y=[1, 3, 2], row=1, col=1, visible=True) fig.add_scatter(y=[3, 1, 1.5], row=1, col=1, visible

One slider controlling multiple subplots in R

大兔子大兔子 提交于 2021-02-20 02:45:50
问题 I want to use one slider to control multiple subplots created with plotly. I found answers in Python like these two: Plot.ly. Using slider control with multiple plots https://community.plot.ly/t/using-one-slider-to-control-multiple-subplots-not-multiple-traces/13955/4 Example (second link): import plotly.graph_objs as go from plotly.tools import make_subplots fig = make_subplots(1, 2) fig.add_scatter(y=[1, 3, 2], row=1, col=1, visible=True) fig.add_scatter(y=[3, 1, 1.5], row=1, col=1, visible

Secondary / Parallel X-Axis on Plotly charts (python)

天涯浪子 提交于 2021-02-19 15:10:40
问题 I need to render at_risk numbers on a Kaplan Meier graph. The end result should be similar to this: The bit I am having trouble rendering is the No. of patients at risk at the bottom of the graph. The values displayed there, correspond to the values on the x-axis. So in essence, it's like a Y-axis rendered in parallel with the X. I have been trying to replicate multiple-axis found here (https://plot.ly/python/multiple-axes/) without success, and also tried having a subplot and hide everything

Secondary / Parallel X-Axis on Plotly charts (python)

霸气de小男生 提交于 2021-02-19 14:54:51
问题 I need to render at_risk numbers on a Kaplan Meier graph. The end result should be similar to this: The bit I am having trouble rendering is the No. of patients at risk at the bottom of the graph. The values displayed there, correspond to the values on the x-axis. So in essence, it's like a Y-axis rendered in parallel with the X. I have been trying to replicate multiple-axis found here (https://plot.ly/python/multiple-axes/) without success, and also tried having a subplot and hide everything

Secondary / Parallel X-Axis on Plotly charts (python)

人盡茶涼 提交于 2021-02-19 14:53:17
问题 I need to render at_risk numbers on a Kaplan Meier graph. The end result should be similar to this: The bit I am having trouble rendering is the No. of patients at risk at the bottom of the graph. The values displayed there, correspond to the values on the x-axis. So in essence, it's like a Y-axis rendered in parallel with the X. I have been trying to replicate multiple-axis found here (https://plot.ly/python/multiple-axes/) without success, and also tried having a subplot and hide everything

Secondary / Parallel X-Axis on Plotly charts (python)

不想你离开。 提交于 2021-02-19 14:52:09
问题 I need to render at_risk numbers on a Kaplan Meier graph. The end result should be similar to this: The bit I am having trouble rendering is the No. of patients at risk at the bottom of the graph. The values displayed there, correspond to the values on the x-axis. So in essence, it's like a Y-axis rendered in parallel with the X. I have been trying to replicate multiple-axis found here (https://plot.ly/python/multiple-axes/) without success, and also tried having a subplot and hide everything

Secondary / Parallel X-Axis on Plotly charts (python)

孤街浪徒 提交于 2021-02-19 14:51:50
问题 I need to render at_risk numbers on a Kaplan Meier graph. The end result should be similar to this: The bit I am having trouble rendering is the No. of patients at risk at the bottom of the graph. The values displayed there, correspond to the values on the x-axis. So in essence, it's like a Y-axis rendered in parallel with the X. I have been trying to replicate multiple-axis found here (https://plot.ly/python/multiple-axes/) without success, and also tried having a subplot and hide everything