Does anyone here know a good way of making a 3d ternary plot of a surface in R? I'm guessing I may have to learn rayshader... #rstats

@sjcowtan

The rayshader package has a plot_gg() function which can convert your ggplot into a 3D rayshader plot: https://www.rayshader.com/reference/plot_gg.html

if you know a bit of ggplot2, it means you don't have to learn quite as much of rayshader if you just want a quick plot!

Transform ggplot2 objects into 3D — plot_gg

Plots a ggplot2 object in 3D by mapping the color or fill aesthetic to elevation. Currently, this function does not transform lines mapped to color into 3D. If there are multiple legends/guides due to multiple aesthetics being mapped (e.g. color and shape), the package author recommends that the user pass the order of the guides manually using the ggplot2 function "guides()`. Otherwise, the order may change when processing the ggplot2 object and result in a mismatch between the 3D mapping and the underlying plot. Using the shape aesthetic with more than three groups is not recommended, unless the user passes in custom, solid shapes. By default in ggplot2, only the first three shapes are solid, which is a requirement to be projected into 3D.

@nrennie oh that's nice! I need a way to avoid going down a massive rabbit hole atm
@sjcowtan @nrennie if you look at the section on examining the vote matrix at https://dicook.github.io/mulgar_book/15-forests.html you’ll see a way to draw the simplex on the observations. Not just 3D, will work for higher dimensions, more than 4 groups too.
Interactively exploring high-dimensional data and models in R - 15  Trees and forests

@visnut oh that's really nice, thank you!