Behavior of identical() in apply in R

亡梦爱人 提交于 2019-12-02 02:22:13

Probably

mapply(identical, x$a, x$b)
#[1] FALSE  TRUE  TRUE FALSE 

where x is a data frame.

As an aside, using apply with a data frame is almost always a mistake. It will coerce the data frame to a matrix which often leads to unexpected results.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!