Learn R Programming

loon.tourr (version 0.1.5)

l_getProjection: Query the matrix of projection vectors

Description

Query the matrix of projection vectors

Usage

l_getProjection(target, data)

Value

a matrix of projection vectors

Arguments

target

A object returned by l_tour

data

Original data set

Examples

Run this code
if(interactive()) {
  dat <- iris[,-5]
  p <- l_tour(dat, color = iris$Species,
              as.l_tour = FALSE)
  # scroll the bar
  proj <- l_getProjection(p, dat)
  projected_object <- as.matrix(dat) %*% proj
  # it will not be exactly the same
  plot(projected_object[,1], projected_object[,2],
       col = hex12tohex6(p['color']))
}

Run the code above in your browser using DataLab