在尝试在map()内部使用管道时,我得到了意外的结果。
map(ls(), ~ . %>% get %>% dim)
返回以下消息:
Functional sequence with the following components:
1. get(.)
2. dim(.)
Use 'functions' to extract the individual functions.
我不太清楚如何使用函数()来得到我想要的结果。
有没有一种使用管道和map的方法来完成它呢?
如果不使用管道,
map(ls(), ~ get(dim(.)))
结果符合我的预期。
lapply(mget(ls()), dim)
(不使用管道)。 - talat