« View all new features in Mathematica 9  previous  |  next 
New in Mathematica 9Built-in Integration with R

Hierarchical Clustering 

Load RLink.
In[1]:=
Click for copyable input
X

Start with some matrix data.

In[2]:=
Click for copyable input
X
Out[2]=

Send the data to R.

In[3]:=
Click for copyable input
X
Out[3]=

Add labels to columns and rows.

In[4]:=
Click for copyable input
X
Out[4]=

Construct correlation and distance matrices.

In[5]:=
Click for copyable input
X
Out[5]=

Call the hierarchical clustering routine.

In[6]:=
Click for copyable input
X
Out[6]=

Define plotting functions from the example on higher-order functions.

In[7]:=
Click for copyable input
X
Out[7]=
In[8]:=
Click for copyable input
X

Produce the dendrogram plots (the "hang" parameter controls the way the dendrogram is plotted).

In[9]:=
Click for copyable input
X
Out[9]=