ggslice | R Documentation |
Following the slice definition available in tourr
this function returns a ggplot2
display of a slice
defined via the projection onto two of the variables.
Note that because the underlying function works with any
projection, the axis labels need to be set by the user.
ggslice(data, h, v1 = 1, v2 = 2, center = NULL, col = NULL)
data |
data frame containing only variables used for the display |
h |
slice thickness |
v1 |
column number of variable mapped to x-axis |
v2 |
column number of variable mapped to y-axis |
center |
center point vector used for anchoring the slice, if NULL the mean of the data is used |
col |
grouping vector mapped to color in the display |
ggplot2 object showing the sliced data
ggslice_projection
d <- geozoo::sphere.hollow(4, 1000)$points
ggslice(d, 0.3, 1, 2)
ggslice(d, 0.3, 1, 2, center = c(0, 0, 0.7, 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.