Skip to content

Different behaviour of data()

1 message · Jan_Svatos@eurotel.cz

#
Thanks to Prof. Ripley for quick and useful answer.
Yes, I will either transfrorm the data-acquiring tool to get the columns as
numbers, not character,
or read them as character, and then manage them with as.factor().

Jan


- - - Original message: - - -
From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
Send: 1/3/02 1:20:11 PM
To: <Jan_Svatos at eurotel.cz> <r-help at stat.math.ethz.ch>
Subject: Re: [R] Different behaviour of data()

This is nothing to do with data().  data uses read.table to read .csv
files, and that *is* in its help file!

Also, these fields are not numeric nor integers but strings, so you can't
expect the standard methods to make sense of them. What `Writing R
Extensions' recommends you should do is to read them in once, correctly,
them dump them as .rda files. *Then* data() will work as you expected.
If you use compression the files might be much smaller, too.

I'm not clear why type.convert is not objecting to overflowing integers,
but that will depend on the implementation of strtol on your platform. We
might manage to improve it.  But in any case I think you ought to read
these fields as character.
On Thu, 3 Jan 2002 Jan_Svatos at eurotel.cz wrote:

            
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._._
--
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._