This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load required libraries | |
library(tm) | |
library(ggplot2) | |
library(lsa) | |
# 1. Prepare mock data | |
text <- c("transporting food by cars will cause global warming. so we should go local.", | |
"we should try to convince our parents to stop using cars because it will cause global warming.", | |
"some food, such as mongo, requires a warm weather to grow. so they have to be transported to canada.", | |
"a typical electronic circuit can be built with a battery, a bulb, and a switch.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
d3.phylogram.js | |
Wrapper around a d3-based phylogram (tree where branch lengths are scaled) | |
Also includes a radial dendrogram visualization (branch lengths not scaled) | |
along with some helper methods for building angled-branch trees. | |
d3.phylogram.build(selector, nodes, options) | |
Creates a phylogram. | |
Arguments: | |
selector: selector of an element that will contain the SVG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
d3.phylogram.js | |
Wrapper around a d3-based phylogram (tree where branch lengths are scaled) | |
Also includes a radial dendrogram visualization (branch lengths not scaled) | |
along with some helper methods for building angled-branch trees. | |
d3.phylogram.build(selector, nodes, options) | |
Creates a phylogram. | |
Arguments: | |
selector: selector of an element that will contain the SVG |