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
4
votes
3 answers

R interactive plot: show vertical line on hover

I have been looking around for a way to draw a vertical line along the x-axis when hovering over points in a plot using R. It does not really matter which package it is, whether it is plotly, ggvis, rCharts, googleVis or any other for that matter,…
Jam
  • 75
  • 3
  • 9
4
votes
1 answer

Dynamically selecting groups in ggvis

So I'm trying to visualize the following data using ggvis because I want to be able to look at different customers and different combination of customers. I'd like to use a line plot and then be able to select two or three and view at them same time…
Hillary
  • 785
  • 1
  • 6
  • 17
4
votes
1 answer

ggvis: Combine multiple datasets in single plot

I have read a similar post on SO, but was not able to adapt the answer to my specific case. I am working with time series data and would like to combine two different data sets into the same plot. Although I could combine the data into one…
Stan
  • 905
  • 9
  • 20
4
votes
0 answers

Increasing all font sizes in ggvis

I'm looking for the ggvis equivalent of this ggplot2 function call: theme(text=element_text(size=20)) Let's take a simple graph made with ggvis: mtcars %>% add_rownames() %>% ggvis(~mpg, ~disp, fill = ~vs) %>% layer_text(text :=…
sharoz
  • 6,157
  • 7
  • 31
  • 57
4
votes
0 answers

Wrong size of ggvis plot in interactive R Markdown

I am trying to add an interactive ggvis plot in an interactive R Markdown file. It works fine, except that the size of the plot is bigger than the assigned space and I always get a "cut" plot and rolling bar. I tried chunk options (out.height and…
JG11235
  • 563
  • 3
  • 11
4
votes
1 answer

Exclude line/points from showing info when using add_tooltip with hover in ggvis

I've been playing around with the nice ggvis package. I'm doing a custom linear regression and wanted a tooltip to show info about each data point. However, when I add my regression line, the tooltip appears when I hover over the line, and shows…
Sölvi
  • 500
  • 5
  • 17
4
votes
1 answer

Passing column name to fill as a string with ggvis

ggvis will automatically colour my plot based on a factor column I pass it. So if my factor column was named "area" I could write this and it would execute perfectly. names = c("Bacilli", "Actinobacteria", "area") b_counts <-…
Jack Simpson
  • 1,681
  • 3
  • 30
  • 54
4
votes
0 answers

How to save a ggvis plot displayed in the Viewer panel of RStudio with an R script?

I am using ggvis with RStudio. For instance: library(ggvis) mtcars %>% ggvis(~mpg, ~wt) %>% layer_points() Then what happens is that a (here static) chart is displayed in the Viewer panel of RStudio. In this panel I can click on the "Export"…
polmath
  • 335
  • 2
  • 13
4
votes
0 answers

Setting hover duration for tooltip in ggvis

Using set_options(hover_duration = 2000) works in this example: library(ggvis) mtcars %>% ggvis(~wt, ~mpg) %>% layer_points(fill.hover := "red") %>% set_options(hover_duration = 2000) However, the option does not appear to work on the…
user2987808
  • 1,387
  • 1
  • 12
  • 28
4
votes
1 answer

Create dynamic ggvis chart from uploaded file in shiny

I am trying to use Shiny and ggvis to: 1) upload a data set 2) have the user select 2 columns (x, y) 3) return a ggvis plot displaying (x, y) from the uploaded data set I've tried editing the examples from the Shiny Interactivity page as well as…
maloneypatr
  • 3,562
  • 4
  • 23
  • 33
4
votes
1 answer

ggvis: x-axis with whole number scale

I want to get whole numbers for x-axis for ggvis plot. MWE df <- structure(list(Factor = structure(c(1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L), .Label = c("A", "B", "C"), class = "factor"), X = c(15.5133333333333, 14.63, 14.41,…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
4
votes
0 answers

add_tooltip not working in ggvis in R

I want to add tooltip containing all variables. But when I use this code I get following error: Error in handlers$add(handler, key, tail) : Key / already in use If I don't use add_tooltip the plot is created without any problem. (The add_tooltip…
umair durrani
  • 5,597
  • 8
  • 45
  • 85
4
votes
0 answers

R ggvis and shiny: layer_model_predictions(model = "lm") Error ... attempt to replicate an object of type 'closure'

I tried to use ggvis with shiny, but got some error with my test sample. The codes are at the end of this message. I got the following error message only when I tried to run ggvis with shiny: Guessing formula = mpg ~ wt Error in rep(col, length.out…
4
votes
1 answer

How do you plot spatial data interactively on a map using both ggvis and a mapping package (ie. ggmap)

I have spatial points which are along a coastline, between years. Using the answer to this, I've plotted the points out and used a slider controlling opacity to show different years. Is it currently possible to overlay a simple map when using…
user3389288
  • 992
  • 9
  • 30
4
votes
2 answers

How do I label plot tick marks using ggvis

I am trying to change the tick labels in a ggvis plot. My data points are x = c(1,2,3) and y = c(1,2,3). However, the following code results in tick labels which make no sense at all! library(dplyr) library(ggvis) data.frame(x = c(1,2,3), y =…
Alex
  • 15,186
  • 15
  • 73
  • 127