[Rquantlib-commits] r266 - in pkg/RQuantLib: . R inst inst/unitTests man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 1 13:51:44 CEST 2010


Author: edd
Date: 2010-07-01 13:51:44 +0200 (Thu, 01 Jul 2010)
New Revision: 266

Modified:
   pkg/RQuantLib/NAMESPACE
   pkg/RQuantLib/R/calendars.R
   pkg/RQuantLib/inst/ChangeLog
   pkg/RQuantLib/inst/unitTests/runit.calendar.R
   pkg/RQuantLib/man/Calendars.Rd
Log:
renamed businessDay() to isBusinessDay(), kept old form for compatibility


Modified: pkg/RQuantLib/NAMESPACE
===================================================================
--- pkg/RQuantLib/NAMESPACE	2010-06-30 21:28:40 UTC (rev 265)
+++ pkg/RQuantLib/NAMESPACE	2010-07-01 11:51:44 UTC (rev 266)
@@ -28,7 +28,7 @@
        "CallableBond",
        "FittedBondCurve",
        ##--calendars.R
-       "businessDay",
+       "isBusinessDay", "businessDay",
        "isHoliday",
        "isWeekend",
        "isEndOfMonth",

Modified: pkg/RQuantLib/R/calendars.R
===================================================================
--- pkg/RQuantLib/R/calendars.R	2010-06-30 21:28:40 UTC (rev 265)
+++ pkg/RQuantLib/R/calendars.R	2010-07-01 11:51:44 UTC (rev 266)
@@ -21,7 +21,7 @@
 ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 ## MA 02111-1307, USA
 
-businessDay <- function(calendar="TARGET", dates=Sys.Date()) {
+isBusinessDay <- function(calendar="TARGET", dates=Sys.Date()) {
     stopifnot(is.character(calendar))
     stopifnot(class(dates)=="Date")
     val <- .Call("QL_isBusinessDay", calendar, dates, PACKAGE="RQuantLib")
@@ -29,6 +29,7 @@
     names(val) <- dates
     val
 }
+businessDay <- function(...) isBusinessDay(...)  ## may get deprecated one day
 
 isHoliday <- function(calendar="TARGET", dates=Sys.Date()) {
     stopifnot(is.character(calendar))

Modified: pkg/RQuantLib/inst/ChangeLog
===================================================================
--- pkg/RQuantLib/inst/ChangeLog	2010-06-30 21:28:40 UTC (rev 265)
+++ pkg/RQuantLib/inst/ChangeLog	2010-07-01 11:51:44 UTC (rev 266)
@@ -151,7 +151,7 @@
 	* man/endOfMonth.Rd: idem
 	* man/isHoliday.Rd: idem
 	* man/holidayList.Rd: idem
-	* man/businessDaysBetwee.Rd: idem
+	* man/businessDaysBetween.Rd: idem
 	* man/adjust.Rd: idem
 	* man/isEndOfMonth.Rd: idem
 	* man/isWeekend.Rd: idem

Modified: pkg/RQuantLib/inst/unitTests/runit.calendar.R
===================================================================
--- pkg/RQuantLib/inst/unitTests/runit.calendar.R	2010-06-30 21:28:40 UTC (rev 265)
+++ pkg/RQuantLib/inst/unitTests/runit.calendar.R	2010-07-01 11:51:44 UTC (rev 266)
@@ -8,5 +8,5 @@
 }
 
 test.isBusinessDay <- function() {
-    checkEquals(businessDay("UnitedStates", as.Date("2004-04-26")), c("2004-04-26"=TRUE), msg="isBusinessDay.US")
+    checkEquals(isBusinessDay("UnitedStates", as.Date("2004-04-26")), c("2004-04-26"=TRUE), msg="isBusinessDay.US")
 }

Modified: pkg/RQuantLib/man/Calendars.Rd
===================================================================
--- pkg/RQuantLib/man/Calendars.Rd	2010-06-30 21:28:40 UTC (rev 265)
+++ pkg/RQuantLib/man/Calendars.Rd	2010-07-01 11:51:44 UTC (rev 266)
@@ -1,12 +1,16 @@
 % $Id$
 \name{Calendars}
+\alias{isBusinessDay}
 \alias{businessDay}
 \title{Calendar functions from QuantLib}
 \description{
-The \code{businessDay} function evaluates the given dates in the context
+The \code{isBusinessDay} function evaluates the given dates in the context
 of the given calendar, and returns a vector of booleans indicating
-business day status.}
+business day status.
+
+The form \code{BusinessDay} is also recognised (but may be deprecated one day).}
 \usage{
+isBusinessDay(calendar="TARGET", dates=Sys.Date())
 businessDay(calendar="TARGET", dates=Sys.Date())
 }
 \arguments{
@@ -42,11 +46,11 @@
   stabilises its own API.}
 \examples{
   dates <- seq(from=as.Date("2009-04-07"), to=as.Date("2009-04-14"), by=1)
-  businessDay("UnitedStates", dates)
-  businessDay("UnitedStates/Settlement", dates)      ## same as previous
-  businessDay("UnitedStates/NYSE", dates)            ## stocks
-  businessDay("UnitedStates/GovernmentBond", dates)  ## bonds
-  businessDay("UnitedStates/NERC", dates)            ## energy
+  isBusinessDay("UnitedStates", dates)
+  isBusinessDay("UnitedStates/Settlement", dates)      ## same as previous
+  isBusinessDay("UnitedStates/NYSE", dates)            ## stocks
+  isBusinessDay("UnitedStates/GovernmentBond", dates)  ## bonds
+  isBusinessDay("UnitedStates/NERC", dates)            ## energy
 }
 \keyword{misc}
 



More information about the Rquantlib-commits mailing list