r-plotly

R: saving multiple html widgets together

自闭症网瘾萝莉.ら 提交于 2021-01-12 06:13:30
问题 I am using the R programming language. I am interested in learning how to save several "html widgets" together. I have been able to manually create different types of html widgets: #widget 1 library(htmlwidgets) library(leaflet) library(RColorBrewer) # create map data map_data <- data.frame( "Lati" = c(43.6426, 43.6424, 43.6544, 43.6452, 43.6629), "Longi" = c(-79.3871, -79.3860, -79.3807, -79.3806, -79.3957), "Job" = c("Economist", "Economist", "Teacher", "Teacher", "Lawyer"), "First_Name" =

R Plotly show string on contour plots

跟風遠走 提交于 2021-01-07 04:00:54
问题 I have overlayed two contour plots: library(plotly) cluster_count <- 5 volcan <- plot_ly(z = ~volcano, type = "contour", contours = list( coloring= "fill", showlines = F )) cluster_matrix <- volcano cluster_matrix[cluster_matrix < 100] <- 1 cluster_matrix[cluster_matrix <= 120 & cluster_matrix >= 100] <- 2 cluster_matrix[cluster_matrix < 140 & cluster_matrix >= 120] <- 3 cluster_matrix[cluster_matrix <= 160 & cluster_matrix >= 140] <- 4 cluster_matrix[cluster_matrix > 160] <- 5 cluster_name

R Plotly show string on contour plots

给你一囗甜甜゛ 提交于 2021-01-07 03:59:20
问题 I have overlayed two contour plots: library(plotly) cluster_count <- 5 volcan <- plot_ly(z = ~volcano, type = "contour", contours = list( coloring= "fill", showlines = F )) cluster_matrix <- volcano cluster_matrix[cluster_matrix < 100] <- 1 cluster_matrix[cluster_matrix <= 120 & cluster_matrix >= 100] <- 2 cluster_matrix[cluster_matrix < 140 & cluster_matrix >= 120] <- 3 cluster_matrix[cluster_matrix <= 160 & cluster_matrix >= 140] <- 4 cluster_matrix[cluster_matrix > 160] <- 5 cluster_name

Combining both grouped bar chart and stacked bar chart using R Plotly

我与影子孤独终老i 提交于 2021-01-01 10:16:24
问题 I am trying to combine both stacked bar and grouped bar chart using plot_ly() . I came across a few questions but couldn't get the perfect solution for this scenario. I came across the solution using ggplot2 . But I need to implement using plot_ly This is the data frame I am trying to plot structure(list(QuarterYear = c("Q4 2019", "Q4 2019", "Q4 2019", "Q4 2019", "Q4 2019", "Q4 2019", "Q4 2019", "Q4 2019", "Q4 2019", "Q4 2019", "Q4 2019", "Q4 2019", "Q1 2020", "Q1 2020", "Q1 2020", "Q1 2020",

R shiny: Freehand drawing ggplot. How to improve and/or format for plotly?

馋奶兔 提交于 2020-12-30 02:35:27
问题 I have a client that wants to be able to "freehand" draw on a plotly (ggplot) graph in Rshiny. I said to use the lasso select button on plotly graphs, but they were not happy that if you click somewhere else on the graph it removes the first lasso. Using this post, I was able to workup a ggplot that I could draw on. I cannot however get it to work with plotly as I do not know the equivalent of the hover options in the ui below. I would love some input on how to do this with plotly, how to

R shiny: Freehand drawing ggplot. How to improve and/or format for plotly?

北战南征 提交于 2020-12-30 02:33:06
问题 I have a client that wants to be able to "freehand" draw on a plotly (ggplot) graph in Rshiny. I said to use the lasso select button on plotly graphs, but they were not happy that if you click somewhere else on the graph it removes the first lasso. Using this post, I was able to workup a ggplot that I could draw on. I cannot however get it to work with plotly as I do not know the equivalent of the hover options in the ui below. I would love some input on how to do this with plotly, how to

Plot multiple time-series lines in 3D with ggplot/plotly

限于喜欢 提交于 2020-12-15 04:56:33
问题 I have a data frame containing different time-series signals which I'm trying to plot in 3D, with the x-axis representing Time, the Y-axis representing a standardized value for all the lines, and the Z-axis showing each line. Here's an example of what I mean. I have a snippet of code I'm trying to configure now to output it properly but I'm not sure how to properly assign the y and z variables. The df contains 5 columns; Time + 4 different time-series signals. plot_ly( data = df, x = df$Time,

Setting my plotly marker size as a variable is not working when using frame (i.e. animated graph)

夙愿已清 提交于 2020-12-13 09:42:56
问题 I'm struggling to get my marker size to work as expected when I'm using it in an animated graph. Using a data set like below, I'd want the marker in column 1 to increase in size, then decrease; the marker in 2 to decrease in size, then increase; etc.: data <- data.frame(xaxis = rep(as.character(c(1:5)), each = 10), yaxis = rep(c(1:5,5:1), 5), size = c( c(1:5,5:1), c(5:1,1:5), c(1:10), c(10:1), rep(c(1,10), 5) ), frame = c(1:10) ) Frustratingly, when I run just one marker (i.e. data is data

Setting my plotly marker size as a variable is not working when using frame (i.e. animated graph)

旧巷老猫 提交于 2020-12-13 09:42:26
问题 I'm struggling to get my marker size to work as expected when I'm using it in an animated graph. Using a data set like below, I'd want the marker in column 1 to increase in size, then decrease; the marker in 2 to decrease in size, then increase; etc.: data <- data.frame(xaxis = rep(as.character(c(1:5)), each = 10), yaxis = rep(c(1:5,5:1), 5), size = c( c(1:5,5:1), c(5:1,1:5), c(1:10), c(10:1), rep(c(1,10), 5) ), frame = c(1:10) ) Frustratingly, when I run just one marker (i.e. data is data

Legend for multi surface plot with specific colors

狂风中的少年 提交于 2020-12-13 07:12:35
问题 Take the example for plot_ly function: library("plotly") z <- c( c(8.83,8.89,8.81,8.87,8.9,8.87), c(8.89,8.94,8.85,8.94,8.96,8.92), c(8.84,8.9,8.82,8.92,8.93,8.91), c(8.79,8.85,8.79,8.9,8.94,8.92), c(8.79,8.88,8.81,8.9,8.95,8.92), c(8.8,8.82,8.78,8.91,8.94,8.92), c(8.75,8.78,8.77,8.91,8.95,8.92), c(8.8,8.8,8.77,8.91,8.95,8.94), c(8.74,8.81,8.76,8.93,8.98,8.99), c(8.89,8.99,8.92,9.1,9.13,9.11), c(8.97,8.97,8.91,9.09,9.11,9.11), c(9.04,9.08,9.05,9.25,9.28,9.27), c(9,9.01,9,9.2,9.23,9.2), c(8.99