tour_pairs: Tour Pairs Plot

Description Usage Arguments Value See Also Examples

Description

A nD tour path with a scatterplot matrix (the default tour is a 4D tour; by setting 'tour_path' to modify the dimension)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
l_tour_pairs(
  data,
  scaling = c("data", "variable", "observation", "sphere"),
  tour_path = tourr::grand_tour(4L),
  numOfTours = 30L,
  interpolation = 40L,
  as.l_tour = TRUE,
  connectedScales = c("none", "cross"),
  linkingGroup,
  linkingKey,
  showItemLabels = TRUE,
  itemLabel,
  showHistograms = FALSE,
  histLocation = c("edge", "diag"),
  histHeightProp = 1,
  histArgs = list(),
  showSerialAxes = FALSE,
  serialAxesArgs = list(),
  color = "grey60",
  group = "color",
  start = NULL,
  parent = NULL,
  span = 10L,
  envir = parent.frame(),
  ...
)

Arguments

data

a data frame with numerical data only

scaling

one of 'variable', 'data', 'observation', 'sphere', or 'none' to specify how the data is scaled. See Details

tour_path

tour path generator, defaults to 2d grand tour

numOfTours

the number of tours

interpolation

the steps between two serial projections. The larger the value is, the smoother the transitions would be.

as.l_tour

return a l_tour object; see details

connectedScales

Determines how the scales of the panels are to be connected.

  • "cross": only the scales in the same row and the same column are connected;

  • "none": neither "x" nor "y" scales are connected in any panels.

linkingGroup

string giving the linkingGroup for all plots. If missing, a default linkingGroup will be determined from deparsing the data.

linkingKey

a vector of strings to provide a linking identity for each row of the data data.frame. If missing, a default linkingKey will be 0:(nrows(data)-1).

showItemLabels

TRUE, logical indicating whether its itemLabel pops up over a point when the mouse hovers over it.

itemLabel

a vector of strings to be used as pop up information when the mouse hovers over a point. If missing, the default itemLabel will be the row.names(data).

showHistograms

logical (default FALSE) to show histograms of each variable or not

histLocation

one "edge" or "diag", when showHistograms = TRUE

histHeightProp

a positive number giving the height of the histograms as a proportion of the height of the scatterplots

histArgs

additional arguments to modify the 'l_hist' states

showSerialAxes

logical (default FALSE) indication of whether to show a serial axes plot in the bottom left of the pairs plot (or not)

serialAxesArgs

additional arguments to modify the 'l_serialaxes' states

color

vector with line colors. Default is given by l_getOption("color").

group

only used for layers. As we scroll the bar, the layers are re-calculated. This argument is used to specify which state is used to set groups (i.e. "color", "linewidth", etc).

start

projection to start at, if not specified, uses default associated with tour path

parent

a valid Tk parent widget path. When the parent widget is specified (i.e. not NULL) then the plot widget needs to be placed using some geometry manager like tkpack or tkplace in order to be displayed. See the examples below.

span

How many column/row occupies for each widget

envir

the environment to use.

...

named arguments to modify the serialaxes states or layouts, see details.

Value

an l_tour_compound object that one can query the loon states and a matrix projection vectors

See Also

l_pairs, l_tour

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
if(interactive() && requireNamespace('tourr')) {
  # q is a `l_pairs` object
  q <- l_tour_pairs(olive[, -c(1:2)],
                    color = olive$region)
  # query the matrix of projection vectors
  proj <- q["projection"]

  # query the `l_compound` widget
  lc <- l_getPlots(q)
  # pack the `density2d` layers
  layer_pack <- lapply(lc, function(w) l_layer_density2d(w))

  #### set `as.l_tour = FALSE`
  # q is a `l_pairs` object
  q <- l_tour_pairs(tourr::flea[, 1:6],
                    as.l_tour = FALSE,
                    color = tourr::flea$species,
                    showHistogram = TRUE,
                    showSerialAxes = TRUE)

  # proj <- q["projection"] # Return a list of `NA`
  # query estimated matrix of projection vectors
  proj <- l_getProjection(q, tourr::flea[, 1:6])
}

loon.tourr documentation built on Oct. 27, 2021, 5:09 p.m.