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
136
votes
6 answers

R Conditional evaluation when using the pipe operator %>%

When using the pipe operator %>% with packages such as dplyr, ggvis, dycharts, etc, how do I do a step conditionally? For example; step_1 %>% step_2 %>% if(condition) step_3 These approaches don't seem to work: step_1 %>% step_2 if(condition) %>%…
mindlessgreen
  • 11,059
  • 16
  • 68
  • 113
23
votes
3 answers

Add a plot title to ggvis

I want to add a title to a ggvis plot. I can't find an example anywhere. It's simple to do with other R plots, e.g. library(ggplot2) library(ggvis) x <- 1:10 y <- x^2 df <- data.frame(x, y) plot(x, y, main = "Plot Title") # Base R with…
Anto
  • 449
  • 5
  • 14
21
votes
1 answer

Dynamic resizing of ggvis plots in shiny apps

When adding a ggvis plot to a shiny app, the width and height of the plot are fixed and don't automatically adjust to the size of the div the ggvis object is placed in. This obviously causes some problems when app users have different screen sizes…
Simon Garnier
  • 555
  • 1
  • 5
  • 12
16
votes
2 answers

Add a horizontal discrete legend below the chart in ggvis

I'd like to make a horizontal legend below the ggvis chart. I can use legend properties to place it below the chart, but don't know how to make the labels horizontal below the legend title. Below is the minimum reproducible code (grabbed from the…
chungkim271
  • 927
  • 1
  • 10
  • 20
16
votes
5 answers

Is it possible with ggvis to interactively change the variables for the x and y axes?

Does anyone know if it is possible to change the variables for the x and y axis interactively with ggvis? I can change the size of the data points, their position and opacity, but I can't work out if its possible to allow the user to select a…
Jack Simpson
  • 1,681
  • 3
  • 30
  • 54
13
votes
1 answer

Create a secondary y axis for lines graph with ggvis R

This is what i have so far with the ggvis package in R. mtcars %>% ggvis(x = ~disp) %>% layer_lines(y = ~wt, stroke := "red") %>% layer_lines(y = ~mpg) %>% add_axis("y", orient = "left", title = "Weight (lb/1000)") %>% …
dimitris_ps
  • 5,849
  • 3
  • 29
  • 55
11
votes
2 answers

Add data to ggvis tooltip that's contained in the input dataset but not directly in the vis

This is my input dataset: > names(breakingbad.episodes) [1] "season" "episode" "epnum" "epid" "title" [6] "url.trakt" "firstaired.utc" "id.tvdb" "rating" "votes" …
Jemus42
  • 629
  • 9
  • 24
10
votes
1 answer

Overlay legend on interactive ggvis plot

I would like to put my legend inside the plot as answered in this question, but for an interactive plot. In the first code chunk the legend disappears off the plot, but when I remove the interaction it works. library(ggvis) library(dplyr) # With…
Tom
  • 4,860
  • 7
  • 43
  • 55
10
votes
1 answer

R: ggvis - gray background (as ggplot2)

I want the ggplot2 look and feel within Ggvis. Is there a way to achieve this within ggvis? I have this from ggvis: Note: 1) Don't like the white background (better the gray one from ggplot2 2) As you see, the bars have an blackline outlined. How…
Omar Gonzales
  • 3,806
  • 10
  • 56
  • 120
10
votes
2 answers

How is data passed from reactive Shiny expression to ggvis plot?

I am getting acquainted with ggvis and I am trying to use it in shiny. I am having trouble understanding how ggvis gets the data from the reactive Shiny expression. Here is the basic app from ggvis GitHub repository: ui.R: shinyUI(pageWithSidebar( …
mpiktas
  • 11,258
  • 7
  • 44
  • 57
8
votes
2 answers

Interactive scatter plots in R, overlay/hover summary/tooltip as user supplied plot function

I have been looking into interactive plots in R. I know that there are several packages to create interactive plots, especially scatterplots, but I am looking for a certain functionality. For example this plot. One can hover with the mouse over the…
Gumeo
  • 891
  • 1
  • 13
  • 26
8
votes
1 answer

Can't get interactive zooming to work with ggvis

I'm trying to get interactive zooming to work in ggvis, more in particular zooming using a brush. Judging from https://github.com/rstudio/ggvis/issues/143 I thought this should work. I have the following shiny and ggvis code (is fully…
Paul Hiemstra
  • 59,984
  • 12
  • 142
  • 149
8
votes
1 answer

ggVis : creating a plot with multiple layers on different dataset

I'm trying to reproduce a ggplot2 plot using ggvis. The plot aims at representing the coordinates of points (from a Correspondence Analysis) together with their clusters (hclust) Standard Dispersion Ellipses. TL; DR I'd like to make a ggvis plot…
RobinCura
  • 410
  • 2
  • 8
8
votes
1 answer

Color path segments in ggvis / layer_paths

I have multiple paths with multiple segments. How does one color the Nth segment of each path with the same color? For example: require(dplyr) require(ggvis) df <- data.frame(x = runif(10,0,10), y = runif(10,0,10), …
schnee
  • 1,050
  • 2
  • 9
  • 20
8
votes
2 answers

custom fill color in ggvis (and other options)

I'm trying to use ggvis to create a NFL strength-of-schedule chart for the 2014 season. The data comes from FootballOutsiders.com, and later I'll make a Shiny app that automatically scrapes data from the website as it's updated during the season.…
rsoren
  • 4,036
  • 3
  • 26
  • 37
1
2 3
32 33