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.
假设我有一个这样的 Julia 数据数组:
Any[Any[1,missing], Any[2,5], Any[3,6]]
我想使用 RCall 将它导入到 R,所以我有一个与此等效的输出:
data <- cbind(c(1,NA), c(2,5), c(3,6))
注意:数据长度是动态的,可能不是3!
谁能帮助我我该怎么做?谢谢
您可以将矩阵插值到 R 中:
a = [ 1 2 3 missing 5 6 ] R"data <- $a"
要将您的“数组数组”重组为矩阵,您需要将它们连接起来
b = Any[Any[1,missing], Any[2,5], Any[3,6]] a = hcat(b...) R"data <- $a"