[R] problem with maptree

Hector Villalobos Ortiz hvillalo at ipn.mx
Wed Feb 8 10:56:27 CET 2006


Hello,

I'm trying to draw a simplified tree of a cluster object 
with maptree, but I get an error message:

	> class(vars.agn)
	[1] "agnes" "twins"

	> draw.clust (clip.clust (vars.agn, k=5))
	Error in "names<-.default"(`*tmp*`, value = c("merge", 
"height", "order",'names' attribute [8] must be the same 
length as the vector [7]

Trying converting first to object of class "hclust":

	> draw.clust (clip.clust (as.hclust(vars.agn), k=5))
	Error in split(x, f) : first argument must be a vector

But conversion seems to work fine:

	> vars.hclust=as.hclust(vars.agn)
	> vars.hclust

	Call:
	agnes(x = daisy(vars.cluster), diss = TRUE, method = 
"ward")

	Cluster method   : ward
	Number of objects: 295


	> draw.clust (clip.clust (vars.hclust, k=5))
	Error in split(x, f) : first argument must be a vector


A previous version of maptree successfully clipped the 
three from the same data. Any orientation will be greatly 
appreciated.
Thank you in advance.

-- 
Héctor Villalobos <hvillalo at ipn.mx>
  IPN-CICIMAR. A.P. 592. Col. Centro
  La Paz, Baja California Sur, MÉXICO. 23000




More information about the R-help mailing list