Learn R Programming

extracat (version 1.7-0)

getpath: Path extracation from quickfechner objects

Description

Uses the path.matrix to obtain the shortest paths of the quickfechner object.

Usage

getpath(fm, pm = NULL, from = 1, to = nrow(fm))

Arguments

fm
A Fechner matrix computed via quickfechner
pm
The path.matrix. Only necessary if the corresponding attribute in fm is missing.
from
Start index.
to
Final index.

Value

  • A vector of indices defining the shortest path from i to j in the original matrix passed to the quickfechner function.

Details

The path.matrix is defined as follows: The entry of the i-th row and j-th column is the index of the last node visited before j on the shortest path from i to j.

Examples

Run this code
#not a distance matrix, but a similarity matrix in some sense
cx <- 1-abs(cor(olives[-c(1,2,11)]))

cx2 <- quickfechner(cx)
getpath(cx2,from=1,to=5)

Run the code above in your browser using DataLab