library(gdata)
library(data.table)
# data.table fails here, data.frame doesn't -------------
df <- data.table(
a = c('asdfasdf','asdf','asdgasdgasdgasdg','sdg'),
b = runif(4,0,1)
)
write.fwf(df,"df.txt")
write.fwf(data.frame(df),"df.txt")
# data.table fails here, data.frame doesn't -------------
df <- data.table(
a = c('asd','qwe','ert','dfg'),
b = runif(4,0,1)
)
write.fwf(df,"df.txt")
write.fwf(data.frame(df),"df.txt")
# data.table does not fail here, nor does data.frame ----
df <- data.table(
a = c(1,5,4,7),
b = runif(4,0,1)
)
write.fwf(df,"df.txt")
write.fwf(data.frame(df),"df.txt")
当我尝试写出 data.table 时的错误消息是我无法连接到write.fwf
应该做的事情 -
Error in setkey(ans, NULL) :
x may no longer be the character name of the data.table. The possibility was undocumented and has been removed.
有人知道为什么吗?