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.
Arguments
- 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
Examples
d <- geozoo::sphere.hollow(4, 1000)$points
ggslice(d, 0.3, 1, 2)
#> Warning: `as.tibble()` was deprecated in tibble 2.0.0.
#> ℹ Please use `as_tibble()` instead.
#> ℹ The signature and semantics have changed, see `?as_tibble`.
#> ℹ The deprecated feature was likely used in the mulgar package.
#> Please report the issue at <https://github.com/dicook/mulgar/issues>.
ggslice(d, 0.3, 1, 2, center = c(0, 0, 0.7, 0))