Skip to content

Instantly share code, notes, and snippets.

View SamGG's full-sized avatar

Samuel Granjeaud SamGG

  • Inserm - CRCM
  • Marseille, France
View GitHub Profile
@dsparks
dsparks / K-means convex hulls.R
Created September 23, 2012 17:14
From holey polygons to convex hulls
# Highlighting clusters, with chull()
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("ggplot2", "RColorBrewer")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Generate some data
nn <- 500
myData <- data.frame(X = rnorm(nn),