[R] subtract a time period from a date

arun smartpink111 at yahoo.com
Tue Oct 30 13:46:06 CET 2012

Try this:
 dat1<-"2011-05-01 CEST"
#[1] "2011-04-01"

----- Original Message -----
From: paladini <paladini at beuth-hochschule.de>
To: r-help at r-project.org
Sent: Tuesday, October 30, 2012 6:25 AM
Subject: [R] subtract a time period from a date

Hello everybody,
how can I reduce e.g. 30 days from a date?
When I do  the following  "2011-05-01 CEST" -"2011-04-01 CEST" I get: "Time difference of 30 days"
an thats fine.

But when I try "2011-05-01 CEST" - 30 I get nonsense.
So how can I subtract some days, month or years from a date?

thanking you in anticipation

Claudia Paladini

R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list