Learn R Programming

spinifex (version 0.1.0)

view_basis: Plot projection frame and return the axes table.

Description

Uses base graphics to plot the circle with axes representing the projection frame. Returns the corresponding table.

Usage

view_basis(basis, labels = paste0("V", 1:nrow(basis)), data = NULL,
  axes = "center")

Arguments

basis

A (p, d) basis, XY linear combination of each dimension (numeric variable).

labels

Optional character vector of p length, add name to the axes in the reference frame, typically the variable names.

data

Optional (n, p) data, plots xy scatterplot on the frame

axes

Position of the axes: "center", "bottomleft" or "off". Defaults to "center".

Value

ggplot object of the basis.

Examples

Run this code
# NOT RUN {
rb <- basis_random(4, 2)
view_basis(basis = rb)

flea_std <- tourr::rescale(tourr::flea[, 1:4])
view_basis(basis = rb, data = flea_std)
view_basis(basis = rb, data = flea_std, axes = "bottomleft")
# }

Run the code above in your browser using DataLab