ggvis package

A ggvis package is a tool used for data visualization in R. It is used to create visual interactive graphics tools for data plotting and representation. The package can be installed into the working space using the following command :

install.packages("ggvis")

The ggvis method in the ggvis package is used to start ggvis graphical window. The ggvis method has the following syntax :

Syntax: ggvis( data , mp1, mp2.,)

Arguments :

  • data – The dataset to plot
  • mp1, mp2,.. – The map variables to plot 

layer_rects() method

The layer_rects() method is used to specify any of the two arguments like height, y or y2, and two of the following arguments, width, x, or x2. In order to create a horizontal stacked bar chart, we use x2=0 and specify height equivalent to the default band() method. 

How to create horizontal stacked bar chart using ggvis in R?

In this article, we are going to learn how to create a horizontal stacked bar chart using ggvis in R programming language.

Similar Reads

ggvis package

A ggvis package is a tool used for data visualization in R. It is used to create visual interactive graphics tools for data plotting and representation. The package can be installed into the working space using the following command :...

Create a horizontal bar chart

To create a horizontal bar chart we need a data frame so we have created a data frame that is used to create a horizontal bar chart with the help of ggvis() method of ggvis library....

Create a horizontal stacked bar chart

...

Contact Us