Questions tagged [ggvis]

The goal of ggvis is to make it easy to describe interactive web graphics in R. It fuses the ideas of ggplot2 and shiny, rendering graphics on the web with vega (so one can draw on the canvas or using svg). It is less flexible than raw d3 or vega, but much more succinct and is tailored to the needs of exploratory data analysis.

From the author(s):

ggvis is a data visualization package for R which lets you:

  • Declaratively describe data graphics with a syntax that is similar to ggplot2.
  • View and interact with the graphics on your local computer, or use them in an interactive web application with shiny.
  • Data manipulation and transformation are done in R, and the graphics are rendered in a web browser, using vega. For RStudio users, ggvis graphics display in a viewer panel, which is possible because RStudio is a web browser.

Data manipulation and transformation are done in R, and the graphics are rendered in a web browser, using Vega. For RStudio users, ggvis graphics display in a viewer panel, which is possible because RStudio is a web browser.

486 questions
8
votes
2 answers

Heat map with numbers in ggvis

I'm trying to replicate the heat map with numbers from ggplot2 in ggvis. ggplot2 version is library(ggplot2) hec <- as.data.frame(xtabs(Freq ~ Hair + Eye, HairEyeColor)) ggplot(hec, aes(Hair, Eye)) + geom_tile(aes(fill = Freq)) +…
kismsu
  • 1,049
  • 7
  • 22
7
votes
1 answer

controlling color of factor group in ggvis - r

I have a question about controlling the color of datapoints in ggvis. I have a dataframe that I am filtering in multiple ways (within a shiny app in case it matters). This leads to often no observations of the group I am coloring data points by…
jalapic
  • 13,792
  • 8
  • 57
  • 87
7
votes
1 answer

Set height and width of entire ggvis plot, including axes and axis labels

I want my ggvis plots to have a specific height and width. Adding %>% set_options(height = 480, width = 480) sizes only the actual plot, i.e. the grid with the data is 480x480. I want to be able to specify the dimensions of the entire image,…
filipsch
  • 195
  • 1
  • 10
7
votes
2 answers

Rstudio shiny ggvis tooltip on mouse hover

In the example below, I have an interactive shiny ggvis plot, but I added a long column that is a long string and for some reason, my hover pop-up shows wt and mpg but does not show long. Also, if the list of elements in the legend is too long,…
719016
  • 9,922
  • 20
  • 85
  • 158
6
votes
1 answer

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

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…
wsda
  • 1,335
  • 1
  • 12
  • 16
6
votes
1 answer

ggvis - Interactive X axis for bar chart

I'm looking into building a shiny app with ggvis. For this I'm using a small dataset called "company". It contains employee data where each line represents and employee. From a ggvis perspective I'm trying the following: Creating a bar chart that…
glnvdl
  • 397
  • 2
  • 12
6
votes
0 answers

ggvis dynamic/interactive plots in a knitr document

I am wondering if somebody has been able to get a dynamic ggvis plot to work with a knitr document. I am getting the following warning when I produce my plot and the interactive tool tip does not work after using knitr. Warning: Can't output…
Danny M.
  • 281
  • 1
  • 12
6
votes
1 answer

Adjusting x limits xlim() in ggplot2 geom_density() to mimic ggvis layer_densities() behavior

Is there a way to make ggplot2's geom_density() function mimic the behavior of ggvis's layer_densities()? That is, make it so p1 looks like p3 (see below) without the call to xlim()? Specifically, I prefer the view that smooths the tails of the…
JasonAizkalns
  • 20,243
  • 8
  • 57
  • 116
6
votes
1 answer

Getting ggvis::export_png() working

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) %>%…
dholstius
  • 1,007
  • 1
  • 7
  • 16
6
votes
2 answers

Proper way to return from ggvis when the data is empty?

My ggvis plot depends on several input fields that work like filter for input data. For some of combinations the resulting data frame is empty and ggvis throws error and breaks the whole application. I tried to put if(nrow(inputdataframe) == 0)…
RInatM
  • 1,208
  • 1
  • 17
  • 39
6
votes
1 answer

Scatter plot in R with ggvis: how to plot multiple groups with different shape markers and corresponding fitted regression lines

To plot the following in R with the ggvispackage, the code is mtcars %>% ggvis(~wt, ~mpg, fill = ~factor(cyl)) %>% layer_points() %>% group_by(cyl) %>% layer_model_predictions(model = "lm") If I change the fill to shape in the above,…
dwstu
  • 839
  • 10
  • 12
6
votes
1 answer

renderUI not executed until a reactive function dependent on renderUI is called

In my shiny app, I have two tabs: tab 1 has a checkboxInput and a selectInput that is encoded as a renderUI in server.R and is shown only if the box is checked. In the tab 2, there is a ggvis function to plot a data frame that is made through a…
bsierieb
  • 178
  • 1
  • 8
6
votes
3 answers

log scale and limits with ggvis

Hi I'm a little confused with the scales in ggvis. I'm trying to do two things: one is have a log scale (the equivalent of log="x" in plot()). I'm also looking for the equivalent of xlim=c(). In both cases, the code below is not giving the expected…
nico S
  • 81
  • 4
6
votes
1 answer

shiny, ggvis, and add_tooltip with HTML

How can I use the tags$... functions from within a ggvis interactive graphic? A "small" and contrived example: library(ggvis) library(shiny) n <- 20 data <- data.frame( xs = 1:n, ys = rnorm(n), color = sample(c('red', 'green', 'blue'), n,…
r2evans
  • 141,215
  • 6
  • 77
  • 149
5
votes
1 answer

Switch plots based on radio buttons in R shiny conditionalPanel

I am trying to create a shiny app with ggvis plots and radio buttons. I have three plots created by ggvis. Users can switch the different plot based on which radio option they select. For example, if user selects A, only plot1 is displayed on user…
wsda
  • 1,335
  • 1
  • 12
  • 16
1
2
3
32 33