### Three diverging lines
ex1 <- generateArtificialLongData()
ex1
#plot(ex1)
### Three diverging lines with high variance
ex2 <- generateArtificialLongData(functionNoise=function(t){rnorm(1,0,3)})
ex2
#plot(ex2)
### Three diverging lines with unbalance groups
ex3 <- generateArtificialLongData(nbEachClusters=c(120,10,40))
ex3
#plot(ex3)
### Three diverging lines with missing data
ex4 <- generateArtificialLongData(percentOfMissing=c(0.5,0,0.25))
ex4
#plot(ex4)
### Four strange functions
ex5 <- generateArtificialLongData(
name="Four strange functions",
clusterNames=c("Line","Poly2","Normal","Sinus"),
nbEachClusters=rep(100,4),
functionClusters=list(function(t){-10+2*t},function(t){-0.6*t^2+6*t-7.5},function(t){10*sin(t)},function(t){30*dnorm(t,2,1.5)}),
functionNoise=function(t){rnorm(1,0,4)},
time=0:10,decimal=2,percentOfMissing=0.3)
ex5
#plot(ex5)
### Here is a data set. Our objectif is to find some clusters...
#layout(1)
#plot(ex5,color=c("black","no","no"))
Run the code above in your browser using DataLab