全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
5133 9
2013-07-21
我需要根据数据中 “存货分类” 的合计数据大小,来绘制一副 板块层级图。类是下图样式:
Map of the Market.png
找到Portfolio包中 map.market函数可以绘制(上图例就是使用此函数绘制的);

但我不知道如何设置map.market函数参数,看论坛中那位用过map.market函数的告诉指点下,(附件中有用到的数据)谢谢!



附件列表

js.rar

大小:13.55 KB

 马上下载

本附件包括:

  • js.csv

二维码

扫码加我 拉你入群

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

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

全部回复
2013-7-21 10:21:22
找到Portfolio包中 map.market函数可以绘制(上图例就是使用此函数绘制的);

但我不知道如何设置map.market函数参数,看论坛中那位用过map.market函数的告诉指点下,(附件中有用到的数据)谢谢!

二维码

扫码加我 拉你入群

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

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

2013-7-24 13:10:03
Arguments

id       
A vector storing the labels to be used for each stock.

area       
A vector storing the values to be used to calculate the areas of rectangles.

group       
A vector specifying the group (i.e. country, sector, etc.) to which each stock belongs.

color       
A vector storing the values to be used to calculate the color of rectangles.

scale       
An object of class numeric indicating the scale to be used in determining colors.

lab       
A logical vector of length 2 specifying whether group and stock labels should be drawn. If the two values are the same, the second may be omitted.

main       
A title for the plot.

print       
An object of class logical indicating whether the map should be drawn.
二维码

扫码加我 拉你入群

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

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

2013-7-24 13:13:11
这里选择分类可能比较重要,否则容易出现:
1: In log(max(w/h, h/w) * sum(z$area) * ((cz^2)/z$area)) : 产生了NaNs
导致出现长度有bug报错
我用你的前300个数据做了一下,
map.market(id=dta$存货名称,
           area=dta$无税金额,
           group=dta$存货分类名称,
           color=dta$数量)
还是有一个类似的图的
二维码

扫码加我 拉你入群

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

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

2013-7-25 13:10:04
glhydxz123 发表于 2013-7-24 13:13
这里选择分类可能比较重要,否则容易出现:
1: In log(max(w/h, h/w) * sum(z$area) * ((cz^2)/z$area)) : ...
对,老是提示长度错误:
代码报错截图


这个问题怎么解决?能把你做的层级板块图 贴上来看看吗?
二维码

扫码加我 拉你入群

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

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

2013-7-25 13:27:50
fcfc2013 发表于 2013-7-25 13:10
对,老是提示长度错误:
代码报错截图
我猜想数据量太大导致的问题,如果拿前20-25个数据去作图还是可以得到一个满意的结果。
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群