楼主: drosophilia
3903 2

[求助]怎么查看str函数返回的某个分量 [推广有奖]

  • 0关注
  • 0粉丝

大专生

16%

还不是VIP/贵宾

-

威望
0
论坛币
51 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
345 点
帖子
32
精华
0
在线时间
0 小时
注册时间
2008-6-14
最后登录
2014-5-5

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
怎么查看str函数返回的某个分量
大致是这样的:
hc <- hclust(dist(USArrests), "ave") #运行hclust函数返回一个对象hc
str(hc)#想利用str函数查看对象hc中的某一个具体分量merge的数值

我这样尝试
bbb=str(hc)
bbb$merge,
结果返回一个null
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:R函数 求助 函数 str 分量

回帖推荐

drosophilia 发表于3楼  查看完整内容

已经解决先str(hc)看清个分量,结构然后回头:hc$merge谢谢了

本帖被以下文库推荐

沙发
zwzpinggu 发表于 2008-6-30 18:56:00 |只看作者 |坛友微信交流群

看看参考文档,?hclust

Value

An object of class hclust which describes the tree produced by the clustering process. The object is a list with components:

mergean n-1 by 2 matrix. Row i of merge describes the merging of clusters at step i of the clustering. If an element j in the row is negative, then observation -j was merged at this stage. If j is positive then the merge was with the cluster formed at the (earlier) stage j of the algorithm. Thus negative entries in merge indicate agglomerations of singletons, and positive entries indicate agglomerations of non-singletons.
heighta set of n-1 non-decreasing real values. The clustering height: that is, the value of the criterion associated with the clustering method for the particular agglomeration.
ordera vector giving the permutation of the original observations suitable for plotting, in the sense that a cluster plot using this ordering and matrix merge will not have crossings of the branches.
labelslabels for each of the objects being clustered.
callthe call which produced the result.
methodthe cluster method that has been used.
dist.methodthe distance that has been used to create d (only returned if the distance object has a "method" attribute).

使用道具

藤椅
drosophilia 发表于 2008-6-30 19:22:00 |只看作者 |坛友微信交流群

已经解决

str(hc)

看清个分量,结构

然后回头:

hc$merge

谢谢了

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-23 12:23