Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个接受向量作为输入的函数。
我有一个ffdfnamed X,并且想使用数据列作为函数输入的向量。
ffdf
X
要将名为“Mag”的数据列作为向量,我将使用以下内容:
X[['Mag']]
但是,ff我相信这是一个向量,并且该函数只会接受法线向量,我该如何将其更改回法线向量?
ff
我想我只需要使用物理组件,但我不知道如何编码。
提前致谢。
您可以[]在最后添加。
[]
X <- as.ffdf(data.frame(Mag = 1:10)) class(X[["Mag"]]) # ff_vector" "ff" class(X[["Mag"]][]) # "integer" # X[, 'Mag'] also works as jbaums suggested class(X[, 'Mag']) # as.vector doesn't work class(as.vector(X[["Mag"]])) # ff_vector" "ff"