我试图通过对其第一列的选择性索引来对 ffdf 对象进行子集化,并遇到以下悖论(不一致?):
# create an ffdf object:
> df_ff=as.ffdf(data.frame( names=c('B','A','B','A','A' ),numbers=1:5))
# 1) Works NOT:
> ffwhich(df_ff[[1]], df_ff[[1]] == 'B')
Error in which(eval(e, nl, envir)) : argument to 'which' is not logical
# 2) Works:
> x = df_ff[[1]]
> ffwhich(x, x == 'B')
ff (open) integer length=2 (2)
[1] [2]
1 3
# 3) As an aside, this also works:
> ffwhich(df_ff, df_ff[[1]] == 'B')
ff (open) integer length=2 (2)
[1] [2]
1 3
步骤 1) 和 2) 之间有什么区别,这对于 ram R 对象是相同的?