Description Usage Arguments Value
View source: R/disto_methods.R
Apply function for data underlying disto object
1 |
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) |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.