proto_default: Wrapper function for default 2D/1D tours respectively.

View source: R/2_ggproto_visualize.r

proto_defaultR Documentation

Wrapper function for default 2D/1D tours respectively.

Description

An easier way to get to default 2D tour settings. Returns a list of proto_origin(), proto_point(...), proto_basis() for 2D. Returns a list of proto_origin1d(), proto_density(...), proto_basis1d() for 1D.

Usage

proto_default(
  position = c("left", "center", "right", "bottomleft", "topright", "off"),
  ...
)

proto_default1d(position = c("bottom1d", "floor1d", "top1d", "off"), ...)

Arguments

position

The position, to place the basis axes relative to the data. proto_basis expects one of c("left", "center", "right", "bottomleft", "topright", "off"), defaults to "left". proto_basis1d expects one of c("bottom1d", "floor1d", "top1d", "off"). Defaults to "bottom1d".

...

Optionally pass additional arguments to proto_point or proto_density.

See Also

Other ggtour proto functions: append_fixed_y(), facet_wrap_tour(), ggtour(), proto_basis(), proto_density2d(), proto_density(), proto_hex(), proto_highlight(), proto_hline0(), proto_origin(), proto_point(), proto_text()

Examples

library(spinifex)
dat  <- scale_sd(penguins_na.rm[, 1:4])
clas <- penguins_na.rm$species

## 2D case:
bas     <- basis_pca(dat)
mv      <- manip_var_of(bas)
mt_path <- manual_tour(bas, mv)

ggt <- ggtour(mt_path, dat) +
  proto_default(aes_args = list(color = clas, shape = clas))

animate_plotly(ggt)

library(spinifex)

## 1D case:
gt_path <- save_history(dat, grand_tour(d = 1), max_bases = 3)

ggt <- ggtour(gt_path, dat) +
  proto_default1d(aes_args = list(fill = clas, color = clas))

animate_plotly(ggt)


spinifex documentation built on March 31, 2022, 9:06 a.m.