楼主: peijianshi
3948 3

split()命令是做什么用的? [推广有奖]

  • 0关注
  • 16粉丝

已卖:352份资源

副教授

80%

还不是VIP/贵宾

-

威望
0
论坛币
638 个
通用积分
2.3662
学术水平
12 点
热心指数
12 点
信用等级
5 点
经验
15373 点
帖子
636
精华
0
在线时间
568 小时
注册时间
2010-3-11
最后登录
2022-9-8

楼主
peijianshi 发表于 2010-4-4 16:46:49 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
现在有一个例子:

> data(cathedral)
> cathedral
style x y
Durham r 75 502
Canterbury r 80 522
....etc....
Old.St.Paul g 103 611
Salisbury g 84 473
> lapply(split(cathedral,cathedral$style),summary)
$g
style x y
g:16 Min. : 45.0 Min. :182
r: 0 1st Qu.: 60.8 1st Qu.:299
Median : 73.5 Median :412
Mean : 74.9 Mean :397
3rd Qu.: 86.5 3rd Qu.:481
Max. :103.0 Max. :611
$r
style x y
g:0 Min. :64.0 Min. :344
r:9 1st Qu.:70.0 1st Qu.:425
Median :75.0 Median :502
Mean :74.4 Mean :475
3rd Qu.:80.0 3rd Qu.:530
Max. :83.0 Max. :551

请问lapply(split(cathedral,cathedral$style),summary)是干嘛用的?
二维码

扫码加我 拉你入群

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

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

关键词:split 做什么 Summary median lapply 命令 split

回帖推荐

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

'split' divides the data in the vector 'x' into the groups defined by 'f'. The replacement forms replace values corresponding to such a division. 'unsplit' reverses the effect of 'split'.

epoh 发表于2楼  查看完整内容

data(cathedral) 25 obs 3 variables style a factor with levels g, Gothic, r, Romanesque x nave height y total length in feet split():Divide into Groups and Reassemble > cathedral style x y Durham r 75 502 Canterbury r 80 522 Gloucester r 68 425 Hereford r 64 344 Norwich r 83 407 Peterborough r 80 ...

本帖被以下文库推荐

沙发
epoh 发表于 2010-4-4 19:04:32
data(cathedral)
25 obs
3  variables
   style a factor with levels g, Gothic, r, Romanesque
   x  nave height
   y  total length in feet

split():Divide into Groups and Reassemble
> cathedral
                    style   x   y
Durham            r  75 502
Canterbury       r  80 522
Gloucester       r  68 425
Hereford           r  64 344
Norwich            r  83 407
Peterborough  r  80 451
St.Albans          r  70 551
Winchester       r  76 530
Ely                      r  74 547
York                   g 100 519
Bath                   g  75 225
Bristol               g  52 300
Chichester       g  62 418
Exeter                g  68 409
GloucesterG    g  86 425
Lichfield            g  57 370
Lincoln              g  82 506
NorwichG         g  72 407
Ripon                g  88 295
Southwark        g  55 273
Wells                 g  67 415
St.Asaph           g  45 182
WinchesterG    g 103 530
Old.St.Paul       g 103 611
Salisbury          g  84 473

> split(cathedral,cathedral$style)
$g
                style   x   y
York            g 100 519
Bath            g  75 225
Bristol         g  52 300
Chichester      g  62 418
Exeter          g  68 409
GloucesterG     g  86 425
Lichfield       g  57 370
Lincoln         g  82 506
NorwichG    g  72 407
Ripon           g  88 295
Southwark   g  55 273
Wells            g  67 415
St.Asaph      g  45 182
WinchesterG     g 103 530
Old.St.Paul     g 103 611
Salisbury        g  84 473

$r
             style  x   y
Durham           r 75 502
Canterbury       r 80 522
Gloucester       r 68 425
Hereford         r 64 344
Norwich          r 83 407
Peterborough     r 80 451
St.Albans        r 70 551
Winchester       r 76 530
Ely              r 74 547

藤椅
friendpine 发表于 2010-4-5 22:28:12
'split' divides the data in the vector 'x' into the groups defined
     by 'f'.  The replacement forms replace values corresponding to
     such a division.  'unsplit' reverses the effect of 'split'.

板凳
peijianshi 发表于 2010-4-6 09:39:53
谢谢!
呵呵,你也阅读了那本书啊。对了上次你给我推荐的那篇英文资料看不懂啊,我的统计学基础不是很好,能告诉我这篇文献大概是再说明什么问题吗?好像涉及对应于任何一点的协方差分析?
(Difficultiues of interpreting mult-slpe analysis of covariance from statistical computer packages)
我正在写一篇论文,但是不晓得方法对不对。
我的邮箱是peijianshi@gmail.com

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-24 20:59