ggvis

ggvis output not appearing in shiny application

有些话、适合烂在心里 提交于 2019-12-31 03:53:27
问题 I'm at a loss for what is wrong here, and the other threads on Stack in which users discuss their ggvis + shiny woes don't seem to apply, in spite of being very similar. First, the basic problem is that my ggvis visualization does not appear in the Shiny app. I have another tab in my Shiny app that shows a data table, and that works fine. Also, when I swap out ggvis and use ggplot2 (leaving the rest of the code intact except for using changing to a compatible function in ui.R that calls the

Exporting ggvis plot with grouped data

爷,独闯天下 提交于 2019-12-31 03:48:05
问题 I've experienced a problem when exporting a ggvis plot (by using vg2png). A simple case works nicely: library(ggvis) mtcars %>% ggvis(x = ~hp, y = ~mpg) %>% export_png() However, if I want to export grouped data, I get the following error: mtcars %>% ggvis(x = ~hp, y = ~mpg) %>% group_by(cyl) %>% export_png() /usr/local/lib/node_modules/vega/vega.js:4799 var tx = vg.data[def.type](); ^ TypeError: Property 'treefacet' of object #<Object> is not a function at vg.parse.transform (/usr/local/lib

How can I add a horizontal line in ggvis?

点点圈 提交于 2019-12-25 04:53:22
问题 I'm trying to learn ggvis, and I'm working on Boston as a tutorial. Basically, I'm trying to convert the ggplot that I worked on into ggvis on Boston data in R. It seems like I can't add horizontal mean line in ggvis. Although I found some hack after googling, but I still couldn't figure it out how I could work it out in my code. Here's my code: library(dplyr, warn.conflicts = FALSE) library(ggvis) Boston %>% ggvis(~chas, ~log(medv), fill=~chas, opacity := 0.8) %>% layer_boxplots(size := 10)

ggvis plots with ISO/IEC 8859-1

天大地大妈咪最大 提交于 2019-12-24 15:36:46
问题 The default encoding for R is ISO/IEC 8859-1 which allows me to work with data containing letters such as å ä ö. However, ggvis does not allow such letters. EDIT: Session info included sessionInfo() R version 3.2.3 (2015-12-10) Platform: i386-w64-mingw32/i386 (32-bit) Running under: Windows 7 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=Swedish_Sweden.1252 LC_CTYPE=Swedish_Sweden.1252 LC_MONETARY=Swedish_Sweden.1252 LC_NUMERIC=C [5] LC_TIME=Swedish_Sweden.1252 attached base packages: [1

ggvis multiple lines with tooltips

感情迁移 提交于 2019-12-24 03:33:03
问题 I am trying to create an interactive Version of this plot: So far I have the following code that creates an interactive plot but is not exactly what I am looking for: #Create Data library(ggvis) set.seed(123) tdat <- data.frame(group = rep(LETTERS[1:2], each = 50), time = rep(seq(from = as.Date("2010-01-01"), length.out = 50, by = "day"), 2), val = c(cumsum(rnorm(50)) + 100, cumsum(rnorm(50)) + 100)) # ggvis Code # Function for the tooltip getData <- function(dat){ paste(paste("Time:", as

Shiny/ggvis Reactivity to Subset Plot Data

与世无争的帅哥 提交于 2019-12-21 19:27:59
问题 After seeing a talk on GGVIS, I have been trying my hand unsuccessfully at creating my first Shiny/ggvis app. My plot works in R, but when I try to migrate it into a Shiny app for display on the web I get nothing. The radio buttons are displayed and from what I can tell seem to be working (I tested using the table from rStudio/Shiny/Reactivity tutorial, but it doesn't seem to place nice with my ggvis plot). I have been following the tutorials on Rstudio and using pieces from the demo folder

R: How to change plot background color for a specific range in ggvis shiny app

☆樱花仙子☆ 提交于 2019-12-21 04:39:49
问题 I have a simple shiny app like below and you can run it. The plots are created by ggvis and user can choose student name from inputSelect . In the plots, I want to change the color of background in specific score range. For example, in each plot , the color of plot background for the score higher than 80 or lower than 50 are highlighted with blue(See picture attached). I was trying to add layers and draw rectangles onto plot using layer_rects() , but the problem is the values of x-axis are

Using ggvis to show longitudinal data, where a slider controls the year

南笙酒味 提交于 2019-12-20 15:09:41
问题 I'm trying to use a slider to control year in a longitudinal spatial data set, essentially a set of scatter plots. I can't figure out how to assign the slider to this variable - can you do this in ggvis? A simplified data set: data <- data.frame(year=rep(2000:2002, each=23), x=rnorm(23*3,10), y=rnorm(23*3,10), count=c(rnorm(23,2), rnorm(23,4), rnorm(23,6))) What I've tried: ### This is what is looks like in ggplot2, I'm aiming to be able to toggle ### between these panels ggplot(data, aes(x,

Getting ggvis::export_png() working

被刻印的时光 ゝ 提交于 2019-12-19 07:53:51
问题 Goal Export a ggvis figure as a PNG file (for inclusion in an .Rmd document). Problem I know essentially nothing about Node.js, other than that it is great and I should know more. I get as far as: library(ggvis) mtcars %>% ggvis(~mpg, ~wt) %>% export_png() Writing to file plot.png Guessing layer_points() module.js:340 throw err; ^ Error: Cannot find module 'd3' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364

Getting ggvis::export_png() working

对着背影说爱祢 提交于 2019-12-19 07:53:06
问题 Goal Export a ggvis figure as a PNG file (for inclusion in an .Rmd document). Problem I know essentially nothing about Node.js, other than that it is great and I should know more. I get as far as: library(ggvis) mtcars %>% ggvis(~mpg, ~wt) %>% export_png() Writing to file plot.png Guessing layer_points() module.js:340 throw err; ^ Error: Cannot find module 'd3' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364