An idea for something better than read.table
Peter Dalgaard BSA
11 Feb 1999 19:31:55 +0100
Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> writes:
> > [There's another loose idea in there involving a control item to handle
> > separators, na.strings, etc. - the intention being that read() plugs
> > in the file= and skip= arguments for the actual call.]
> > Would this be an approach worth pursuing?
> I think so. However, why can't we extend scan() accordingly?
> what = list(Item = factor(levels=1:4,labels=c("A","B","C","D")),
> Size = numeric(),
> Year = factor(levels=1980:1985)))
We could, and in a sense that is what I'm suggesting, but:
- the argument syntax is a bit clumsy, I'd like to have the variables
through a ... argument.
- scan *evaluates* the arguments and then looks at the type.
Evaluating things like
currently gives a "missing x" error, but even if we fixed that, it
could never give anything better than
Levels: A B C D
i.e. the levels= specification would be forgotten. The only way to
circumvent that is to have scan working on nonevaluated arguments.
So I thought that one might as well start over with a completely new
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (firstname.lastname@example.org) FAX: (+45) 35327907
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: email@example.com