使用lapply时出错

时间:2017-05-02 01:54:42

标签: r dataframe lapply dimensions

获取

Error "incorrect number of dimensions"

我已加载内置数据框cars

library(datasets)
data("cars")
lapply(cars,'[',1) #This will get the first row works fine
lapply(cars,'[',,1) #This should give me the first column but it gives me error incorrect dimensions

我也尝试将数据帧转换为列表,它给了我正确的行,但没有给出相同错误的列。

0 个答案:

没有答案