[Rd] lm(difftime~1) works but summary(lm(difftime~1)) throws an error

Spencer Graves @pencer@gr@ve@ @end|ng |rom prod@y@e@com
Sun Jun 26 21:31:26 CEST 2022


Hello, All:


	  Consider the following:


 > dates123 <- as.Date('2022-01-01')+rep(1:3, 1:3)
 > d_dates123 <- diff(dates123, units='days')
 > fit123 <- lm(d_dates123~1)
 > summary(fit123)
Error in Ops.difftime((f - mean(f)), 2) :
   '^' not defined for "difftime" objects


	  I can get around it:


fit123. <- lm(as.numeric(d_dates123)~1)
summary(fit123.)


	  However, I felt a need to report this anomaly.


	  Thanks for all you do to make it easier for peasants to do statistics.


	  Spencer Graves



More information about the R-devel mailing list