【发布时间】:2012-11-27 10:52:43
【问题描述】:
我尝试在 R 中使用bigmemory 包,但我一开始就被卡住了。我愿意:
temp <- matrix(paste("a",1:10), 5, 2)
并得到一个字符矩阵。没关系。但后来我尝试:
x <- as.big.matrix(temp, type="char")
我得到一个充满 NA 的矩阵和以下消息:
Assignment will down cast from double to char
Hint: To remove this warning type: options(bigmemory.typecast.warning=FALSE)
Warning messages:
1: In as.big.matrix(temp, type = "char") : Casting to numeric type
2: In matrix(as.numeric(x), nrow = nrow(x), dimnames = dimnames(x)) :
NAs introduced by coercion
3: In SetElements.bm(x, i, j, value) :
我不确定发生了什么,但它看起来很大。尽管type = "char",matrix 仍试图将我的所有文本转换为数字。如何让它发挥作用?
【问题讨论】:
标签: r matrix character r-bigmemory