cordillera (version 0.8-0)

e_optics: OPTICS in ELKI

Description

A rudimentary I/O interface to OPTICS in 'ELKI' reroutes input from R to elki via the command line, runs elki.optics on an Input file (config.txt), sets up a temporary directory opticsout in path, reads in the contents of the elki output file clusterobjectorder.txt and deletes I/O files and directories. Returns the contents or clusterobjectorder.txt as a data frame. needs ELKI > 0.6.0 - Only tested with the Ubuntu trusty binaries very rudimentary as of yet. API of ELKI is not fixed. No plans for using this in the future.

Usage

e_optics(x, minpts = 2, epsilon, path = tempdir(), keep = FALSE)

Value

a list with the contents of the elki output file as a data frame as element

  • $clusterobjectorder, which is the clusterobjectorder file from elki. The first column is the OPTICS ordering (so the ID of the points in successive order), followed by the data in x, the next column lists the reachability followed by the predecessor of each point x[i,] in the ordering in the last column

  • $eps

  • $minpts

Arguments

x

numeric matrix or data frame

minpts

the minpts argument to elki. Defaults to 2.

epsilon

The epsilon parameter for OPTICS. Defaults to 2 times the range of x.

path

the path for storing the temporary files I/O files. Defaults to tempdir().

keep

should the optics results from elki be stored in path. If TRUE, it will make a directory ./opticsout and a file config.txt

Examples

Run this code
# \donttest{
data(iris)
res<-e_optics(iris[,1:4],minpts=2,epsilon=100)
print(res)
summary(res)
plot(res,withlabels=TRUE)
# }


Run the code above in your browser using DataCamp Workspace