[R] Incompatible methods ("-.POSIXt", "Ops.difftime") for "-"

From: Albrecht, Dr. Stefan (APEP) <stefan.albrecht_at_apep.com>
Date: Mon, 8 Oct 2007 12:17:39 +0200

Dear all,  

according to the Help-page of DateTimeClasses {base} I should be able to do

time - z


time 	date-time objects
z 	a numeric vector (in seconds) or an object of class "difftime".

However, on R version 2.6.0 (Windows XP) I get
> Sys.time() - as.difftime(c("0:3:20", "11:23:15"))
Time differences in mins
[1] 1191837998 1191837318
[1] ""
Warning message:
Incompatible methods ("-.POSIXt", "Ops.difftime") for "-"

This works, on the other hand:
> Sys.time() - as.numeric(as.difftime(c("0:3:20", "11:23:15")))
[1] "2007-10-08 12:16:18 Westeuropäische Normalzeit" "2007-10-08 12:04:58 Westeuropäische Normalzeit"

Am I understanding something wrongly?

Many thanks and best regards,

Dr. Stefan Albrecht, CFA
Allianz Private Equity Partners GmbH
Königinstr. 19 | 80539 Munich | Germany

Phone: +49.(0)89.3800.18317
Fax: +49.(0)89.3800.818317
EMail: stefan.albrecht_at_allianz.com <mailto:stefan.albrecht_at_allianz.com> Web: www.apep.com <http://www.apep.com/>

Allianz Private Equity Partners GmbH | Geschäftsführung: Wan Ching Ang, Karl Ralf Jung Sitz der Gesellschaft: München | Registergericht: München HRB 126221 | Ust-ID-Nr.: DE 813 264 786

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 08 Oct 2007 - 10:24:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 21 Nov 2007 - 11:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.