[R] Difference in 'read.table' between R.1.4.1 and R1.5.0

Prof Brian D Ripley ripley at stats.ox.ac.uk
Wed May 8 16:18:17 CEST 2002


There is no change in read.table.  'NA' is not a class, and never has been,
The help page has always said use NA, not use 'NA', and (as the NEWS for
1.5.0 points out) you now have to use NA when you mean it.

as() is in package methods, and provides extensibility if package methods
is loaded.

On Wed, 8 May 2002 james.holtman at convergys.com wrote:

> This sequence of commands worked fine in R.1.4.1.  The data file was the
> same in both instances:
>
> >    acct.log <- read.table(file, col.names=c('cmd', 'user', 'start',
> 'end',
> +         'elapsed', 'sys', 'usr', 'cpu', 'char', 'blocks'),
> +         colClasses=c('NA', 'NA', rep('numeric', 7),'integer'),
> +         comment.char='')
> > version
>          _
> platform i386-pc-mingw32
> arch     x86
> os       Win32
> system   x86, Win32
> status
> major    1
> minor    4.1
> year     2002
> month    01
> day      30
> language R
> >
>
>
> When run under R.1.5.0, I got the following error:
>
> > acct.log <- read.table(file, col.names=c('cmd', 'user', 'start', 'end',
> +      'elapsed', 'sys', 'usr', 'cpu', 'char', 'blocks'),
> +      colClasses=c('NA', 'NA', rep('numeric', 7),'integer'),
> +      comment.char='')
> Error: couldn't find function "as"
> > version
>          _
> platform i386-pc-mingw32
> arch     i386
> os       mingw32
> system   i386, mingw32
> status
> major    1
> minor    5.0
> year     2002
> month    04
> day      29
> language R
> >
>
>
> There appears to be a call to "as" in read.table, but this object if not
> defined:
>
>  for (i in 1:cols) {
>         if (known[i])
>             next
>         data[[i]] <- if (!is.na(colClasses[i]))
>             as(data[[i]], colClasses[i])
>         else type.convert(data[[i]], as.is = as.is[i], dec = dec)
>     }
>
>
>
>
> --
>
> NOTICE:  The information contained in this electronic mail transmission is
> intended by Convergys Corporation for the use of the named individual or
> entity to which it is directed and may contain information that is
> privileged or otherwise confidential.  If you have received this electronic
> mail transmission in error, please delete it from your system without
> copying or forwarding it, and notify the sender of the error by reply email
> or by telephone (collect), so that the sender's address records can be
> corrected.
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list