楼主: oliyiyi
1634 16

A Simple Guide to S3 Methods [推广有奖]

11
oliyiyi 发表于 2016-11-7 14:57:09 |只看作者 |坛友微信交流群
To summarize, the important feature of S3 methods worth noting is that only the first part, summary, is required to be used on these objects of different classes.

使用道具

12
oliyiyi 发表于 2016-11-7 14:59:53 |只看作者 |坛友微信交流群
Hiding the trailing text after the . avoids the need to use a different summary function for every class. This means that one does not need to remember to use summary.lm for linear models, or summary.data.frame for data frames, or summary.aProposterousClassOfObject. By using S3 methods, cognitive load is reduced – you don’t have to think as much to remember what class an object is – and the commands are more intuitive. To get a summary of most objects, use summary, to plot most objects, use plot. Perhaps the most nifty feature of all is that a user can create their own S3 methods using the same functions such as summary and plot.

使用道具

太厉害了。。

使用道具

14
oliyiyi 发表于 2016-11-7 15:24:40 |只看作者 |坛友微信交流群
Creating your own S3 method is not particularly difficult and is usually highly practical. A use case scenario for creating an S3 method is now discussed.

使用道具

15
mmeng555 发表于 2016-11-7 16:41:15 |只看作者 |坛友微信交流群
支持!

使用道具

16
janyiyi 发表于 2016-12-1 21:28:22 |只看作者 |坛友微信交流群
谢谢分享

使用道具

17
花茶物语 发表于 2017-1-5 15:35:58 |只看作者 |坛友微信交流群
thanks for sharing

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

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

GMT+8, 2024-4-26 11:54