I agree with Jesse. For your problem take a look at the Rowv, distfun and hclustfunarguments of the heatmap function.
For more choices the functions heatmap.2 in the gplots package, heatmap_plus in the Heatplus package and pheatmap in the pheatmap package could be of some use.