[Rd] Patch for "units<-" in datetime.R
Jeffrey Horner
jeff.horner at vanderbilt.edu
Thu Feb 22 23:10:52 CET 2007
Index: src/library/base/R/datetime.R
===================================================================
--- src/library/base/R/datetime.R (revision 40781)
+++ src/library/base/R/datetime.R (working copy)
@@ -381,7 +381,7 @@
if (from == value) return(x)
if (!(value %in% c("secs", "mins", "hours", "days", "weeks")))
stop("invalid units specified")
- sc <- cumprod(c(sec=1, mins=60, hours=60, days=24, weeks=7))
+ sc <- cumprod(c(secs=1, mins=60, hours=60, days=24, weeks=7))
newx <- as.vector(x)*sc[from]/sc[value]
structure(newx, units=value, class="difftime")
}
Cheers,
Jeff
--
http://biostat.mc.vanderbilt.edu/JeffreyHorner
More information about the R-devel
mailing list