File: apclusterDemo.R

package info (click to toggle)
r-cran-apcluster 1.4.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,744 kB
  • sloc: cpp: 1,258; ansic: 346; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 580 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
apclusterDemo <- function(l=100, d=2, seed=NA, ...)
{
    if (!is.na(seed)) set.seed(seed)

    if (round(l) != l || l < 2)
        stop("'l' must be an integer at least as large as 2")
    else if (round(d) != d || d < 1)
        stop("'d' must be an integer at least as large as 1")

    x <- matrix(runif(l * d), c(l, d))
    s <- negDistMat(x, r=2)

    # Call function apcluster(), turn on details for later plotting
    apresultObj <- apcluster(s, details=TRUE, ...)

    show(apresultObj)
    plot(apresultObj)

    invisible(list(x, s, apresultObj))
}