Stacked dot plot using ggplot2 - r

I am interested in making a stacked dotplot like the one in link below in ggplot2.
The following was made using dotPlot function in BHH2 package but does not have the coloring and faceting ease of ggplot2.

There is a geom_dotplot which create dotplots. Update your ggplot2 if you don't have it. It is a relatively recent addition.
See this for examples.

Related

Is it possible to set a theme with plotly in R?

plot_ly(x,y,z, type="scatter3d") + theme_igray()
Returns NULL. Is it possible at all to have theme with plotly?
The theme_igray() call looks like something from ggplot2. I don't think the plotly package supports ggplot2 themes, but ggplotly can convert a ggplot2 graph to plotly format, so you could theme it in ggplot2 then convert.
Unfortunately, there's no ggplot2 graph that corresponds to type="scatter3d". The gg3D package will produce a 2D graph in plotly.

How do I Create a Faceted Bar Graph with Different Discrete X Axis in R ggplot

I have a bar graph which looks like the following:
Problem: If I facet it by the same variable as the color, the x-axis has space for plotting all the bars even though I don't need them.
My Solution: I used multiplot function from the Rmisc to separately make bar graphs for each partner but then a lot of individual customization is needed to make the graphs go cohesively together.
Question: Is there another way that I can use to get closer to plot 2 without the extra spaces for the variables that don't apply.
I'm using ggplot to plot.
use:
+ facet_wrap(~variable_to_facet_by,
scales = 'free')
as part of your ggplot code and that should get you what you want.

Combined ggplot and plotrix

I need to add a Y axis break to a plot I made in ggplot. Is it possible to use the gap.barplot function in plotrix in a graph in ggplot? When I try, it cancels everything I did in ggplot and plots just the gap.barplot bit.
Thank you
Barbara
Unfortunately NO.
They work on two different "worlds".
I've been trying a lot but it seems (just like #Mark Peterson wrote) that doing this in ggplot is nearly impossible on purpose
You should look into these questions and answers which are very similiar:
Using ggplot2, can I insert a break in the axis?
Broken barplot using R/ggplot2

R: levelplot vs. contourplot

I want to plot a contour of my data in R.
What is the difference between levelplot vs. contoutplot in package lattice and latticeExtra in R?
The 'latticeExtra' package contains none of the functions you mention.
Briefly, 'levelplot' fills in colored squares, while 'contourplot' makes curved lines like a topographic map.
But the best way for you to see is to simply look at and run the code for the examples for the two functions in the lattice package.

How do I draw a violin plot using ggplot2?

Can I use ggplot2 to produce a violin plot? Perhaps using some variation of geom_boxplot()?
Version 0.9.0 includes the geom_violin: http://docs.ggplot2.org/current/geom_violin.html
A quick googling returns this site, which uses geom_ribbon to draw violin plots for Figure 3.14.
Note to anyone catching up
As #Ben points out below, geom_violin() is now the preferred method for producing violin plots in ggplot2.

Resources