全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
1628 1
2014-06-19
rapply() 中的参数how = c("unlist", "replace", "list"),list和unlist是分别以列表和非列表的形式输出结果,replace呢?有人知道吗,求指点,R的帮助看不太懂啊
If how = "replace", each element of the list which is not itself a list and has a class included in classes is replaced by the result of applying f to the element.
If the mode is how = "list" or how = "unlist", the list is copied, all non-list elements which have a class included in classes are replaced by the result of applying f to the element and all others are replaced by deflt. Finally, if how = "unlist", unlist(recursive = TRUE) is called on the result.
二维码

扫码加我 拉你入群

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

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

全部回复
2014-12-11 21:33:00
这个函数整体是这样的——
rapply(object, f, classes = "ANY", deflt = NULL, how = c("unlist", "replace", "list"), ...)


如果how = "replace",这本身并不是一个list,
使用了replace之后,f函数就作用于object中每一个元素,
得出的运算结果,取代之前的每个元素。





二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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