Last data update: 2014.03.03

R: Spirals Data Set Generator
spiralsR Documentation

Spirals Data Set Generator

Description

Produce a data set of spiral clusters.

Usage

spirals(n=c(100,100,100),sd=c(0,0,0))

Arguments

n

a vector of integer. The lenght of the vector is the number of clusters and each number corrisponds to the number of data points in each cluster.

sd

amount of noise for each spiral.

Value

The function returns a two dimensional data set.

Author(s)

Stefano Cacciatore and Leonardo Tenori

References

Cacciatore S, Luchinat C, Tenori L.
Knowledge discovery by accuracy maximization.
Proc Natl Acad Sci U S A 2014;111(14):5117-22.

See Also

helicoid,dinisurface,swissroll

Examples

par(mfrow=c(2,2))
v1=spirals(c(100,100,100),c(0.1,0.1,0.1))
plot(v1,col=rep(2:4,each=100))
v2=spirals(c(100,100,100),c(0.1,0.2,0.3))
plot(v2,col=rep(2:4,each=100))
v3=spirals(c(100,100,100,100,100),c(0,0,0.2,0,0))
plot(v3,col=rep(2:6,each=100)) 
v4=spirals(c(20,40,60,80,100),c(0.1,0.1,0.1,0.1,0.1))
plot(v4,col=rep(2:6,c(20,40,60,80,100)))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(KODAMA)
Loading required package: e1071
Loading required package: plsgenomics
Loading required package: MASS
Loading required package: boot
Loading required package: parallel
Loading required package: class

Attaching package: 'KODAMA'

The following object is masked from 'package:plsgenomics':

    transformy

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/KODAMA/spirals.Rd_%03d_medium.png", width=480, height=480)
> ### Name: spirals
> ### Title: Spirals Data Set Generator
> ### Aliases: spirals
> ### Keywords: dataset
> 
> ### ** Examples
> 
> par(mfrow=c(2,2))
> v1=spirals(c(100,100,100),c(0.1,0.1,0.1))
> plot(v1,col=rep(2:4,each=100))
> v2=spirals(c(100,100,100),c(0.1,0.2,0.3))
> plot(v2,col=rep(2:4,each=100))
> v3=spirals(c(100,100,100,100,100),c(0,0,0.2,0,0))
> plot(v3,col=rep(2:6,each=100)) 
> v4=spirals(c(20,40,60,80,100),c(0.1,0.1,0.1,0.1,0.1))
> plot(v4,col=rep(2:6,c(20,40,60,80,100)))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>