Description Usage Arguments Value Examples
View source: R/data_genDONUTS.R
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.
1 |
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). |
a named list containing with m = nk:
an (m\times 2) data matrix.
a length-m vector(factor) for class labels.
1 2 3 4 5 6 7 8 9 10 11 12 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.