[R] Mapping 2D to 3D

Abby Spurdle @purd|e@@ @end|ng |rom gm@||@com
Mon Sep 21 10:43:02 CEST 2020


Hi H,

I probably owe you an apology.
I was just reading the geom_contour documentation.
It's difficult to follow.

Base R functions, my functions, and pretty much everyone's functions,
take a matrix as input.
But as far as I can tell, geom_contour wants a data.frame with three
{x, y and z} coordinates.
It's not clear how the data in the data.frame is mapped onto the {x,
y, and z} coordinate system.

Also, it uses density estimation in *all* its examples.
Making it difficult for inexperienced users to tell the difference
between contour plots (generally) and density visualization.

I would suggest base R functions as a better starting point:

contour
filled.contour
image
heatmap
persp

I have a package named barsurf, with (almost) density-free examples:
https://cran.r-project.org/web/packages/barsurf/vignettes/barsurf.pdf

Additionally, there are functions in the lattice package, and possibly
the rgl package.



More information about the R-help mailing list