Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
# Klout scores
klouts <- read.csv("klout-scores.csv", header=TRUE)
# Radiuses for rendering bubbles
radius <- sqrt( klouts$klout_score / pi )
# Competitor matrix
competitors <- read.csv("competitors.csv", header=TRUE)
# Co-ords for plotting competitors
coords <- cmdscale(competitors, k=2)
# Plot the co-ordinates
plot(coords, type="n")
# Fill colours
fill_colours <- c()
for (i in 1:length(klouts$type)) {
if (klouts$type[i] == "us") {
fill_colours <- c(fill_colours, "#CBE11D")
else if (klouts$type[i] == "current") {
fill_colours <- c(fill_colours, "#2DB3CB")
else if (klouts$type[i] == "future") {
fill_colours <- c(fill_colours, "#BC006B")
# Show competitors
symbols(coords, circles=radius, inches=0.35, fg="white", bg=fill_colours, xlab="X", ylab="Y")
# Label competitors
text(coords, labels=names(competitors), cex=0.5, col="white")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.