shapes.two.moon: Generation of data set containing two clusters with untypical...

View source: R/shapes.r

shapes.two.moonR Documentation

Generation of data set containing two clusters with untypical shapes (similar to waxing and waning crescent moon)

Description

Generation of data set containing two clusters with untypical shapes (similar to waxing and waning crescent moon). For each point first random radius r from given interval is generated then random angle alpha and finally the coordinates of point are calculated as (a+abs(r*cos(alpha)),r*sin(alpha) for first shape and (-abs(r*cos(alpha)),r*sin(alpha)-b for second shape

Usage

shapes.two.moon(numObjects=180,shape1a=-0.4,shape2b=1,shape1rFrom=0.8,
shape1rTo=1.2,shape2rFrom=0.8, shape2rTo=1.2, outputCsv="", outputCsv2="", 
outputColNames=TRUE, outputRowNames=TRUE)

Arguments

numObjects

number of objects in each cluster - positive integer value or vector with length=2

,

shape1a

parameter a for first shape

shape2b

parameter b for first shape

shape1rFrom

minimal value of radius for first shape

shape1rTo

maximal value of radius for first shape

shape2rFrom

minimal value of radius for second shape

shape2rTo

maximal value of radius for second shape

outputCsv

optional, name of csv file with generated data (first column contains id, second - number of cluster and others - data)

outputCsv2

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

outputColNames=TRUE indicates that output file (given by outputCsv and outputCsv2 parameters) contains first row with column names

outputRowNames

outputRowNames=TRUE indicates that output file (given by outputCsv and outputCsv2 parameters) contains a vector of row names

Value

clusters

cluster number for each object

data

generated data - matrix with objects in rows and variables in columns

Author(s)

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 http://keii.ue.wroc.pl/clusterSim/

See Also

shapes.worms,shapes.circles2,shapes.circles3,shapes.bulls.eye,shapes.blocks3d

Examples

library(clusterSim)
stm<-shapes.two.moon(180)
plot(stm$data,col=rainbow(2)[stm$clusters])

clusterSim documentation built on May 25, 2022, 9:09 a.m.