In Matlab you can designate the number of nodes in a dendrogram that you wish to plot as part of the dendrogram function: dendrogram(tree,P) generates a dendrogram plot with no more than P leaf nodes. 
My attempts to do the same with heatmap2 in R have failed miserably. The posts to stackoverflow and biostars have suggested using cutree but heatmap2 gets stuck with postings' suggestions on Rowv option.  Here "TAD" is the data matrix 8 columns by 831 rows.
# cluster it
hr <- hclust(dist(TAD, method="manhattan"), method="average")
# draw the heat map
heatmap.2(TAD, main="Hierarchical Cluster",
          Rowv=as.dendrogram(cutree(hr, k=5)),
          Colv=NA, dendrogram="row", col=my_palette, density.info="none", trace="none")
returns the message:
Error in UseMethod("as.dendrogram") : 
  no applicable method for 'as.dendrogram' applied to an object of class "c('integer', 'numeric')"
Is using cutree the correct avenue to explore for plotting a restricted dendrogram?  Is there any easier way to do this akin to matlab?
 
     
    
