楼主: yilian7219
1605 5

[书籍介绍] Data.Manipulation.with.R 2014 [推广有奖]

  • 0关注
  • 0粉丝

大专生

1%

还不是VIP/贵宾

-

威望
0
论坛币
553 个
通用积分
0.1837
学术水平
0 点
热心指数
1 点
信用等级
0 点
经验
1128 点
帖子
12
精华
0
在线时间
56 小时
注册时间
2013-10-11
最后登录
2017-4-24

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
R语言数据操作,英文版。 PP.Data.Manipulation.with.R.Jan.2014.pdf (972.24 KB, 需要: 5 个论坛币)
二维码

扫码加我 拉你入群

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

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

关键词:manipulation ulation ATION Data With 艺术 Series

本帖被以下文库推荐

沙发
wh7064rg 发表于 2015-5-2 11:45:59 |只看作者 |坛友微信交流群
  1. Factors from numeric variables

  2. Numeric variables are convenient during statistical analysis, but sometimes we need to create categorical (factor) variables from numeric variables. We can create a limited number of categories from a numeric variable using a series of conditional statements, but this is not an efficient way to perform this operation. In R, cut is a generic command to create factor variables from numeric variables. In the following example, we will see how we can create factors from a numeric variable, using a series of conditional statements. We will also use the cut command to perform the same task.

  3. # creating a numeric variable by taking 100 random numbers
  4. # from normal distribution
  5. set.seed(1234) # setting seed to reproduce the example
  6. numvar <- rnorm(100)

  7. # creating factor variable with 5 distinct category

  8. num2factor <- cut(numvar,breaks=5)
  9. class(num2factor)
  10. [1] "factor"
  11. levels(num2factor)
  12. [1] "(-2.35,-1.37]"  "(-1.37,-0.389]" "(-0.389,0.592]" "(0.592,1.57]"   "(1.57,2.55]"
  13. table(num2factor)
  14. num2factor
  15. (-2.35,-1.37] (-1.37,-0.389] (-0.389,0.592]  (0.592,1.57]  (1.57,2.55]
  16.       7            43              29             13            8
复制代码

使用道具

藤椅
Nicolle 学生认证  发表于 2015-9-7 23:19:00 |只看作者 |坛友微信交流群
提示: 作者被禁止或删除 内容自动屏蔽

使用道具

板凳
Nicolle 学生认证  发表于 2015-9-7 23:28:11 |只看作者 |坛友微信交流群
提示: 作者被禁止或删除 内容自动屏蔽

使用道具

报纸
johnmy 发表于 2016-7-13 04:05:03 |只看作者 |坛友微信交流群
好象下载过,谢谢了。

使用道具

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

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

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

GMT+8, 2024-4-28 01:21