R: levelplot vs. contourplot - r

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.

Related

How do you plot a 3d scatterplot with multiple facets?

I'm trying to plot a 3d scatterplot (let's use this previous question as an example), but as a grid with multiple 3D scatterplots on the same page based on a categorical factor. I see how many people can do this with, for example, boxplots, but have no idea how to do so with a 3-d scatterplot. Any thoughts would be very helpful.
You can do this with the cloud function in the lattice package, although it probably doesn't offer as much easy fine-scale control as scatterplot3d- or rgl-based plots:
set.seed(101)
d <- data.frame(x=runif(1000),y=runif(1000),z=runif(1000),
f=factor(sample(1:10,replace=TRUE,size=1000)))
library("lattice")
cloud(z~x*y|f,data=d)

how to use ggplot2 make recursive partitioning survival tree

can everyone tell me how to use ggplot2 make recursive partitioning survival tree?
I know " party " package can make a plot in R, however the plot is not looking good, and all the plots in the rest of my report are made by ggplot2.
for my plot, I printsreen and added labels manually. if there is a way to input data and plot in R also works, Thanks!!

3d Vector plotting and visualization in R

Anyone know of any packages in R that can plot 3D vectors? I would like to plot some vectors over a 3 dimensional data set. I know scatterplot3d looks like it should be able to do the job, but I didn't see any documentation for vectors specifically (I would like to be able to change the origin of vectors as well).
rgl is a great package for 3d plotting. It is very like 2d plotting except that you use plot3d instead of plot. This answer on SO suggests a way to draw arrows in rgl.

Stacked dot plot using ggplot2

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.

Can I use shingles from lattice in ggplot2 in R

It is possible to use the shingles to define specific ranges in ggplot2. As far as i understand shingles are a way to generate groups. Can we create such shingles and use them in ggplot2 facet_grid to obtain graphs?
Following up from the comments, ggplot can't draw shingles (in the way lattice draws shingles with special indicators in the strip) and by default doesn't have a means of producing the overlapping groups.
However, I cam across this excellent PDF document which aims to produce a gpplot2 version of every figure in Depayan's excellent Lattice book (Lattice: Multivariate Data Visualization with R).
Page 31 contains a custom function fn() which replicates the behaviour of equal.count(), as far as I can tell, to provide the correct data structure to plot with overlapping shingles. The PDF contains plenty of examples of "shingles" in ggplot that you can play with.
So not sure if this answers the Q - but at least it appears one can fudge ggplot into producing plots that use the shingle concept.

Resources