FAQ
Hi,

x1 <- c(as.Date("20110101","%Y%m%d"),as.Date("2012-01-01","%Y-%m-%d"));
x2 <- c("1","2");

ddf <- data.frame(x=x1,y=x2);
ddf[["y"]] <- as.factor(ddf[["y"]])

write.arff(ddf, file="D:/ddf.arff")

Content of ddf.arff is

@relation ddf
@attribute x numeric
@attribute y {'1','2'}
@data
2011-01-01,'1'
2012-01-01,'2'


Here x is of type Date, but write.arff write it as numeric, but the actual content is string, the result file is not with valid ARFF file format(Weka can't read it in).
I think write.arff should write it as @attribute x DATE "yyyy-MM-dd"


Regards





Xiaobo Gu

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupr-help @
categoriesr
postedNov 20, '11 at 4:42a
activeNov 20, '11 at 4:42a
posts1
users1
websiter-project.org
irc#r

1 user in discussion

Xiaobo Gu: 1 post

People

Translate

site design / logo © 2022 Grokbase