getpath: Path extracation from quickfechner objects

Description Usage Arguments Details Value Author(s) Examples

View source: R/fechner.R

Description

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

Usage

1
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.

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.

Value

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

Author(s)

Alexander Pilhoefer

Examples

1
2
3
4
5
#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)

extracat documentation built on July 17, 2018, 5:05 p.m.

Related to getpath in extracat...