Sent: Wednesday, August 08, 2012 1:02 PM
| To: David Reiner
| Cc: r-sig-finance@r-project.org; d...@eddelbuettel.com
| Subject: Re: [R-SIG-Finance] getEndOfMonth and getEndOfBizWeek in RcppBDT
broken?
|
|
| Ok, bug found. In the R file definining the convenience functions
|
| getEndOfBi
Thanks, Dirk. You're the best!
-- David
-Original Message-
From: Dirk Eddelbuettel [mailto:e...@debian.org]
Sent: Wednesday, August 08, 2012 1:02 PM
To: David Reiner
Cc: r-sig-finance@r-project.org; d...@eddelbuettel.com
Subject: Re: [R-SIG-Finance] getEndOfMonth and getEndOfBizWe
Ok, bug found. In the R file definining the convenience functions
getEndOfBizWeek <- function(date = Sys.Date()) {
stopifnot(inherits(date, "Date"))
bdt$getEndOfBizWeek(date)
}
getEndOfMonth <- function(date = Sys.Date()) {
stopifnot(inherits(date, "Date"))
bdt$getEndOfMonth(dat
On 8 August 2012 at 11:17, David Reiner wrote:
| At least on my setup, they don't seem to work:
|
| > getEndOfBizWeek(date=as.Date('2012-09-05'))
| [1] "2012-08-10"
| > getEndOfMonth(date=as.Date('2012-09-05'))
| [1] "2012-08-31"
Dang. The functions hang off a package-global instance of the BDT
At least on my setup, they don't seem to work:
> getEndOfBizWeek(date=as.Date('2012-09-05'))
[1] "2012-08-10"
> getEndOfMonth(date=as.Date('2012-09-05'))
[1] "2012-08-31"
> sessionInfo()
R version 2.15.1 Patched (2012-06-25 r59634)
Platform: x86_64-pc-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=