[R] origin and "origin<-" functions on chron

davidr@rhotrading.com davidr at rhotrading.com
Wed Nov 16 00:02:53 CET 2005


I'm trying to use/modify some code I found (at Omegahat, but I've seem similar usage elsewhere.)
It contains the lines:
   if(any(origin(chronDate)!=orig))
      origin(chronDate) <- orig

Let's say:
> require("chron")
[1] TRUE
> chronDate <- chron("11/15/2005", format="m/d/y", origin.=c(12,31,1899))
> orig <- c(month=12, day=31, year=1899)
> origin(chronDate)
Error: couldn't find function "origin"
> origin(chronDate) <- orig
Error: couldn't find function "origin<-"

I'm sure I'm missing something simple here, but what? I've looked in the archives and docs quite a lot....

Thanks for the help!

R-2.2.0 on Windows XP (SP2)

> R.Version()
$platform
[1] "i386-pc-mingw32"
$arch
[1] "i386"
$os
[1] "mingw32"
$system
[1] "i386, mingw32"
$status
[1] ""
$major
[1] "2"
$minor
[1] "2.0"
$year
[1] "2005"
$month
[1] "10"
$day
[1] "06"
$"svn rev"
[1] "35749"
$language
[1] "R"

David L. Reiner
 
Rho Trading
440 S. LaSalle St.
Chicago  IL  60605
312-362-4963
 




More information about the R-help mailing list