File:ScagnosticsBase.svg

Summary

Description
English: Convex hull, alpha shape and minimal spanning tree of a bivariate data set.
Date
Source Own work
Author Sigbert
 
This W3C-unspecified chart was created with R.
Category:Unspec SVG created with R#00100229ScagnosticsBase.svg
library("mlbench")
library("alphahull")
library("igraph")
data(BostonHousing)
x <- cbind(BostonHousing$lstat, BostonHousing$medv)
x <- unique(x)
svg("scagnosticsBase.svg", width=10, height=3)
par(mfrow=c(1,3), mar=c(0,0,2,0))
hull  <- chull(x)
shape <- ashape(x, alpha=5)
hull <- c(hull, hull[1])
plot(x, main="Convex hull", axes=F, pch=19, cex=0.5)
lines(x[hull, ])
box()
plot(x, main="Alpha shape", axes=F, pch=19, cex=0.5)
plot(shape, add=T, wpoints=F)
box()
graph <- graph.adjacency(as.matrix(dist(x)), weighted=TRUE)
mst   <- as.undirected(minimum.spanning.tree(graph))
idx   <- get.edges(mst, E(mst))
plot(x, main="Minimal spanning tree", axes=F, pch=19, cex=0.5)
for (i in seq(nrow(idx))) {
  ft <- idx[i,]
  lines(x[ft,1], x[ft,2])
}
box()
dev.off()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-3.0#ScagnosticsBase.svg
Category:Self-published work Category:Scatterplots Category:Convex hull Category:Alpha shape Category:Minimum spanning trees
Category:Alpha shape Category:CC-BY-SA-3.0 Category:Convex hull Category:Minimum spanning trees Category:Scatterplots Category:Self-published work Category:Unspec SVG created with R