Skip to content

Instantly share code, notes, and snippets.

@dwinter
Created August 10, 2015 16:13
Show Gist options
  • Save dwinter/0a72f8b23922bc9d9218 to your computer and use it in GitHub Desktop.
Save dwinter/0a72f8b23922bc9d9218 to your computer and use it in GitHub Desktop.
Flag phylogeny
traits <- read.csv("flag_traits.csv")
dist_mat <- dist(traits, "manhattan")
tr <- ape::nj(dist_mat)
plot(tr)
##Rooting the tree (arbitrarily) will make a nicer plot
#rooted <- ape::root(tr, node=50)
#plot(rooted)
koru star fern
0 1 0
1 1 0
0 1 1
0 0 1
1 0 0
1 1 0
0 1 1
1 0 0
0 1 0
0 1 0
0 0 1
0 1 0
1 0 0
1 1 0
0 0 1
1 1 0
0 1 0
1 0 0
0 1 1
1 0 0
1 1 0
0 1 0
1 1 0
1 1 0
0 0 0
1 0 0
0 0 1
0 1 0
0 1 1
0 0 1
1 0 0
1 1 0
1 1 0
1 0 0
1 0 0
1 1 0
0 0 1
0 0 0
0 0 1
1 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment