【发布时间】:2019-06-08 15:34:14
【问题描述】:
这是关于 R 内部的问题。整数 NA 值如何在 R 中表示? 与浮动不同,没有神奇的位序列来表示 NaN。
# Create big array. newer versions of R won't allocate memory to store data
# Instead star/end values are stored internally
a <- 1:1e6 #
# Change some random value. This will cause and array to be allocated
a[123] <- NA
typeof(a)
此时a仍然是一个整数数组。 a[123] 如何在内部表示? R 是否使用一些幻数来指示整数为 NA?
我对整数内部表示的主要兴趣与二进制读/写(readBin/writeBin)有关。使用外部源执行二进制 I/O 时如何处理 NA,例如通过套接字?
【问题讨论】:
-
也许这会给你一个答案:stackoverflow.com/questions/51684861/…
标签: r