[Rd] S3 weirdness

Gabor Grothendieck ggrothend|eck @end|ng |rom gm@||@com
Thu Jun 24 23:56:32 CEST 2021


If we start up a vanilla session of R with no packages loaded and
type the single line of code below as the first line entered then
we get the output shown below.  The NA in the output and the length
of 7 indicate that as.ts dispatched as.ts.zoo since as.ts.default
would have resulted in a length of 6 with no NA's. It should not have
known about as.ts.zoo since we never  explicitly loaded the zoo
package using library or require.
zoo:: was only used to refer to read.zoo.  This seems to be a bug in
the way R is currently working.

  as.ts(zoo::read.zoo(BOD))
  ## Time Series:
  ## Start = 1
  ## End = 7
  ## Frequency = 1
  ## [1]  8.3 10.3 19.0 16.0 15.6   NA 19.8

  R.version.string
  ## [1] "R version 4.1.0 RC (2021-05-16 r80303)"

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-devel mailing list