# \dontshow{
# sampling is online done
# because otherwise the example takes too long
# in the CRAN check
data(ITS)
ind=sample(length(ITS),1000)
#clustering only for testing
Classification=c(rep(1,8805),rep(2,2389))
DataVisualizations::ClassMDplot(ITS[ind],Classification[ind])
# }
# \donttest{
data(ITS)
#shortcut for example if AdaptGauss not installed
Classification = kmeans(ITS, centers = 2)$cluster
#better approach
#please download package from cran
#model=AdaptGauss::AdaptGauss(ITS)
#Classification=AdaptGauss::ClassifyByDecisionBoundaries(ITS,
#DecisionBoundaries = AdaptGauss::BayesDecisionBoundaries(model$Means,model$SDs,model$Weights))
ClassNames=c(1,2)
names(ClassNames)=c("Insert name \n of Class 1","Insert name \n of Class 2")
ClassMDplot(ITS,Classification,ClassNames = ClassNames)
# }
Run the code above in your browser using DataLab