Following my posting of a write.table() function, Martin suggested that one could have a generic write() function and special methods for e.g. time series, data frames, etc. Well, a month has passed since ... What does everyone think? Is it a good idea, or would write.table() be enough? If we think that it is not enough, which arguments should the write methods typically allow? What about write.xxx (x, # object file = # filename, default stdout append = # obvious sep = # obvious eol = # end of line char ...) ??? On the other hand, it seems clear that something like write.table() is nice, and what it should do. But what about classes other than data.frame? -k =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Note that S has a write(.) function which would be our write.default(.) your write.table would be our write.data.frame The only addition would be a 'write.matrix' which would be 'like' write.data.frame, the only problem being that 'matrix' is not a class (yet). [Note that in S4, everything has a class; I'm voting for matrices to have a class in R ..] write.default could 'despatch' to write.matrix if x is a matrix. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Any comparison with NULL generates an error Error: comparison is possible only for vector types whereas in S(-PLUS) it gives NA, which seems more sensible. Along similar lines, comparison with a length 0 vector returns logical(0) in R but NA in S. Thomas Lumley ------------------------------------------------------+------ Biostatistics : "Never attribute to malice what : Uni of Washington : can be adequately explained by : Box 357232 : incompetence" - Hanlon's Razor : Seattle WA 98195-7232 : : ------------------------------------------------------------ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-