View source: R/explore_space.R
explore_space_pca | R Documentation |
The set of functions returns a primary ggplot object
that plots the data object in a space reduced by PCA.
compute_pca()
computes the PCA and explore_space_pca()
plots the bases in the PCA-projected space
explore_space_pca( dt, details = FALSE, pca = TRUE, group = NULL, color = NULL, ..., animate = FALSE ) flip_sign(dt, group = NULL, ...) compute_pca(dt, group = NULL, random = TRUE, flip = TRUE, ...)
dt |
a data object collected by the projection pursuit guided tour optimisation in |
details |
logical; if components other than start, end and interpolation need to be shown |
pca |
logical; if PCA coordinates need to be computed for the data |
group |
the variable to label different runs of the optimiser(s) |
color |
the variable to be coloured by |
... |
other arguments received from |
animate |
logical; if the interpolation path needs to be animated |
random |
logical; if random bases from the basis space need to be added to the data |
flip |
logical; if the sign flipping need to be performed |
explore_space_pca()
a ggplot object for diagnosing the optimisers in the PCA-projected basis space
flip_sign()
a list containing
a matrix of all the bases
a logical value whether a flip of sign is performed
a dataframe of the original dataset
compute_pca()
a list containing
the PCA summary
a dataframe with PC coordinates augmented
Other main plot functions:
explore_space_tour()
,
explore_trace_interp()
,
explore_trace_search()
dplyr::bind_rows(holes_1d_geo, holes_1d_better) %>% bind_theoretical(matrix(c(0, 1, 0, 0, 0), nrow = 5), index = tourr::holes(), raw_data = boa5 ) %>% explore_space_pca(group = method, details = TRUE) + scale_color_discrete_botanical() dplyr::bind_rows(holes_1d_geo, holes_1d_better) %>% flip_sign(group = method) %>% str(max = 1) dplyr::bind_rows(holes_1d_geo, holes_1d_better) %>% compute_pca(group = method)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.