加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

R语言的内置数据集操作

(2015-02-06 14:16:53)
标签:

股票

分类: R语言

当我使用arules包内内置数据集groceries时,不管怎么写函数,都看不到数据集内容,只能看到概括有多少数据行列。怎么才能看到里面的向量和数据呢?

表现如下:

> data(Groceries)> Groceries
transactions in sparse format with
9835 transactions (rows) and
169 items (columns)
> tail(Groceries)
transactions in sparse format with
6 transactions (rows) and
169 items (columns)
> head(Groceries)
transactions in sparse format with
6 transactions (rows) and
169 items (columns)

 

:::解决方法如下:::

#数据集

Groceries@data@p
#向量值
Groceries@itemInfo

 


@是对象操作符

 

ps:::

 

输入typeof(Groceries)

输出s4

数据的类型有很多,甚至还有密文形式的,这个属于S4类 类型    R S4类面向对象,详情可参考http://blog.fens.me/r-class-s4/

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有