tick-sub-.disto-tick: Extract from a disto object in matrix style extraction

Description Usage Arguments Value Examples

Description

Extract a disto object in matrix style extraction and via direct indexing. 'product' specification allows both outer (matrix output, default option) and inner (vector) product type extraction. For dist backend see: dist_extract.

Usage

1
2
## S3 method for class 'disto'
x[i, j, k, product = "outer"]

Arguments

x

object of class 'disto'

i

(integer vector) row indexes

j

(integer vector) column indexes

k

(integer vector) direct indexes

product

(string) One among: "inner", "outer"

Value

When product is 'outer', returns a matrix. Else, a vector.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
temp <- stats::dist(iris[,1:4])
dio <- disto(objectname = "temp")
dio
names(dio) <- paste0("a", 1:150)

dio[1, 2]
dio[2, 1]
dio[c("a1", "a10"), c("a5", "a72")]
dio[c("a1", "a10"), c("a5", "a72"), product = "inner"]
dio[k = c(1,3,5)]

talegari/disto documentation built on May 10, 2019, 3:19 a.m.