Generation of data set containing two clusters with untypical parabolic shapes (first is given by y=x^2, second by y=-(x-a)^2+b with distortion from <-tol,+tol>)
shapes.worms(numObjects=180,shape1x1=-2,shape1x2=2,shape2x1=-0.5,
shape2x2=2.5,shape2a=1.5,shape2b=5.5,tol=0.1,outputCsv="", outputCsv2="",
outputColNames=TRUE, outputRowNames=TRUE)
cluster number for each object
generated data - matrix with objects in rows and variables in columns
number of objects in each cluster - positive integer value or vector with length=2
starting value on abscissa axis for shape 1
end value on abscissa axis for shape 1
starting value on abscissa axis for shape 2
end value on abscissa axis for shape 2
parameter a
of shape 2
parameter b
of shape 2
tolerance - each generated point is randomized by adding runif(1,0,tol)
optional, name of csv file with generated data (first column contains id, second - number of cluster and others - data)
optional, name of csv (a comma as decimal point and a semicolon as field separator) file with generated data (first column contains id, second - number of cluster and others - data)
outputColNames=TRUE
indicates that output file (given by outputCsv
and outputCsv2
parameters) contains first row with column names
outputRowNames=TRUE
indicates that output file (given by outputCsv
and outputCsv2
parameters) contains a vector of row names
Marek Walesiak marek.walesiak@ue.wroc.pl, Andrzej Dudek andrzej.dudek@ue.wroc.pl
Department of Econometrics and Computer Science, University of Economics, Wroclaw, Poland
shapes.worms
,shapes.circles2
,shapes.circles3
,shapes.bulls.eye
,shapes.two.moon
,shapes.blocks3d
library(clusterSim)
sw<-shapes.worms(180)
plot(sw$data,col=rainbow(2)[sw$clusters])
Run the code above in your browser using DataLab