dapply {disto}R Documentation

Matrix like apply function for disto object

Description

Apply function for data underlying disto object

Usage

dapply(x, margin = 1, fun, subset, nproc = 1)

Arguments

x

disto object

margin

(one among 1 or 2) dimension to apply function along

fun

Function to apply over the margin

subset

(integer vector) Row/Column numbers along the margin

nproc

Number of parallel processes (unix only)

Value

Simplified output of 'sapply' like function temp <- dist(iris[,1:4]) dio <- disto(objectname = "temp")

# function to pick indexes of 5 nearest neighbors # an efficient alternative with Rcpp is required udf <- function(x) dim(x) <- NULL order(x)[1:6] hi <- dapply(dio, 1, udf)[-1, ] dim(hi)


[Package disto version 0.2.0 Index]