data-visualization

R: for the same code, labels (q1, median) appear on one computer but don't appear on another computer

两盒软妹~` 提交于 2021-01-10 03:44:30
问题 I am using the R programming language. I made a simple box plot using the "plotly" library: library(plotly) library(ggplot2) var_1<-rnorm(100,10,5) var_2 <- sample( LETTERS[1:4], 100, replace=TRUE, prob=c(0.1, 0.2, 0.65, 0.05) ) df = data.frame(var_1, var_2) df$var_2 = as.factor(df$var_2) p5 <- plot_ly(df, y = ~var_1, color = ~var_2, type = "box") %>% layout(title = "Income by career stage", xaxis = list(title = "Stage", zeroline = FALSE), yaxis = list(title = "Income", zeroline = FALSE)) p5

R: for the same code, labels (q1, median) appear on one computer but don't appear on another computer

て烟熏妆下的殇ゞ 提交于 2021-01-10 03:36:21
问题 I am using the R programming language. I made a simple box plot using the "plotly" library: library(plotly) library(ggplot2) var_1<-rnorm(100,10,5) var_2 <- sample( LETTERS[1:4], 100, replace=TRUE, prob=c(0.1, 0.2, 0.65, 0.05) ) df = data.frame(var_1, var_2) df$var_2 = as.factor(df$var_2) p5 <- plot_ly(df, y = ~var_1, color = ~var_2, type = "box") %>% layout(title = "Income by career stage", xaxis = list(title = "Stage", zeroline = FALSE), yaxis = list(title = "Income", zeroline = FALSE)) p5

R: for the same code, labels (q1, median) appear on one computer but don't appear on another computer

浪子不回头ぞ 提交于 2021-01-10 03:29:23
问题 I am using the R programming language. I made a simple box plot using the "plotly" library: library(plotly) library(ggplot2) var_1<-rnorm(100,10,5) var_2 <- sample( LETTERS[1:4], 100, replace=TRUE, prob=c(0.1, 0.2, 0.65, 0.05) ) df = data.frame(var_1, var_2) df$var_2 = as.factor(df$var_2) p5 <- plot_ly(df, y = ~var_1, color = ~var_2, type = "box") %>% layout(title = "Income by career stage", xaxis = list(title = "Stage", zeroline = FALSE), yaxis = list(title = "Income", zeroline = FALSE)) p5

R Language: Code Taking a Long Time to Run

跟風遠走 提交于 2021-01-07 02:52:51
问题 The bounty expires in 5 days . Answers to this question are eligible for a +50 reputation bounty. stats555 is looking for a canonical answer : I am using the R programming language. I am trying to use the "plotly" library to make interactive time series plots as shown in this tutorial over here : plotly.com/r/custom-buttons and plotly.com/r/cumulative-animations . I generated some artificial time series data that matches the structure of the data shown in the tutorial - now I am trying to

Convert “regular” plot to ggplot object (and then plotly)

青春壹個敷衍的年華 提交于 2021-01-07 02:50:00
问题 I am using the R programming language. I incorporated my own code along with a lengthy tutorial over here : https://michael.hahsler.net/SMU/EMIS7332/R/viz_classifier.html . In the end, I produced a visual "plot" (see the end of this code, "final_plot") library(cluster) library(Rtsne) library(dplyr) library(randomForest) library(caret) library(ggplot2) library(plotly) #PART 1 : Create Data #generate 4 random variables : response_variable ~ var_1 , var_2, var_3 var_1 <- rnorm(10000,1,4) var_2<

Convert “regular” plot to ggplot object (and then plotly)

无人久伴 提交于 2021-01-07 02:49:57
问题 I am using the R programming language. I incorporated my own code along with a lengthy tutorial over here : https://michael.hahsler.net/SMU/EMIS7332/R/viz_classifier.html . In the end, I produced a visual "plot" (see the end of this code, "final_plot") library(cluster) library(Rtsne) library(dplyr) library(randomForest) library(caret) library(ggplot2) library(plotly) #PART 1 : Create Data #generate 4 random variables : response_variable ~ var_1 , var_2, var_3 var_1 <- rnorm(10000,1,4) var_2<

R: how to plot a “time series” with ggplot2

只谈情不闲聊 提交于 2021-01-07 02:39:04
问题 I simulated some time series data in R, aggregated by every 8 days, and then tried to plot the results. However, the plots are not working. I have posted my code below: #load library library(xts) library(ggplot2) set.seed(123) #simulate data property_damages_in_dollars <- rnorm(731,100,10) date_decision_made = seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") date_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d") final_data <- data.frame(date_decision_made, property

R: plotly time series graphs

你离开我真会死。 提交于 2021-01-07 02:38:29
问题 I am using the R programming language. I found some examples on the plotly r website that I am trying to replicate: https://plotly.com/r/cumulative-animations/ and https://plotly.com/r/custom-buttons/ I created some artificial time series data: library(xts) library(ggplot2) library(dplyr) library(plotly) #create data #time series 1 date_decision_made = seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") date_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d") property_damages

R: plotly time series graphs

穿精又带淫゛_ 提交于 2021-01-07 02:37:31
问题 I am using the R programming language. I found some examples on the plotly r website that I am trying to replicate: https://plotly.com/r/cumulative-animations/ and https://plotly.com/r/custom-buttons/ I created some artificial time series data: library(xts) library(ggplot2) library(dplyr) library(plotly) #create data #time series 1 date_decision_made = seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") date_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d") property_damages

R: plotting graphs (ggplot vs autoplot)

落花浮王杯 提交于 2021-01-05 08:57:55
问题 I am following a R tutorial over here https://rviews.rstudio.com/2017/09/25/survival-analysis-with-r/ The computer I use for work does not have internet access nor a USB port - it only has R with some preinstalled libraries. The tutorial requires "survival", "ggplot2", "ranger", "dplyr" and "ggfortify". The computer I use for work has all of these libraries EXCEPT ggfortfiy. Apparently, a function called "autoplot" is required from the ggfortify library to make some of the plots in this