genDONUTS {T4cluster} | R Documentation |
Generate Nested Donuts
Description
It generates nested donuts, which are just hollow circles. For flexible
testing, the parameter k
controls the number of circles of varying
radii where n
controls the number of observations for each circle.
Usage
genDONUTS(n = 50, k = 2, sd = 0.1)
Arguments
n |
the number of data points for each hollow circle (default: 50). |
k |
the number of circles (default: 2). |
sd |
magnitude of white noise (default: 0.1). |
Value
a named list containing with m = nk
:
- data
an
(m\times 2)
data matrix.- label
a length-
m
vector(factor) for class labels.
Examples
## generate data
donut2 = genDONUTS(k=2)
donut3 = genDONUTS(k=3)
donut4 = genDONUTS(k=4)
## visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3), pty="s")
plot(donut2$data, col=donut2$label, pch=19, main="k=2")
plot(donut3$data, col=donut3$label, pch=19, main="k=3")
plot(donut4$data, col=donut4$label, pch=19, main="k=4")
par(opar)
[Package T4cluster version 0.1.2 Index]