[Rquantlib-commits] r285 - in pkg/RQuantLib: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Aug 3 00:19:16 CEST 2010
Author: edd
Date: 2010-08-03 00:19:16 +0200 (Tue, 03 Aug 2010)
New Revision: 285
Removed:
pkg/RQuantLib/man/holidayList.Rd
Modified:
pkg/RQuantLib/R/calendars.R
pkg/RQuantLib/man/Calendars.Rd
Log:
folded holidayList.Rd into Calendars.Rd
copied holidayList() into getHolidayList(), old form still allowed
Modified: pkg/RQuantLib/R/calendars.R
===================================================================
--- pkg/RQuantLib/R/calendars.R 2010-08-02 22:09:57 UTC (rev 284)
+++ pkg/RQuantLib/R/calendars.R 2010-08-02 22:19:16 UTC (rev 285)
@@ -130,10 +130,10 @@
val
}
-holidayList <- function(calendar="TARGET",
- from=Sys.Date(),
- to=Sys.Date() + 5,
- includeWeekends=0) {
+getHolidayList <- function(calendar="TARGET",
+ from=Sys.Date(),
+ to=Sys.Date() + 5,
+ includeWeekends=0) {
stopifnot(is.character(calendar))
stopifnot(class(from)=="Date")
stopifnot(class(to)=="Date")
@@ -144,6 +144,10 @@
val
}
+holidayList <- function(calendar="TARGET", from=Sys.Date(), to=Sys.Date() + 5, includeWeekends=0) {
+ getHolidayList(calendar, from, to, includeWeekends)
+}
+
setCalendarContext <- function(calendar="TARGET",
fixingDays = 2,
settleDate = Sys.Date() + 2) {
Modified: pkg/RQuantLib/man/Calendars.Rd
===================================================================
--- pkg/RQuantLib/man/Calendars.Rd 2010-08-02 22:09:57 UTC (rev 284)
+++ pkg/RQuantLib/man/Calendars.Rd 2010-08-02 22:19:16 UTC (rev 285)
@@ -7,6 +7,8 @@
\alias{isEndOfMonth}
\alias{getEndOfMonth}
\alias{endOfMonth}
+\alias{getHolidayList}
+\alias{holidayList}
\title{Calendar functions from QuantLib}
\description{
The \code{isBusinessDay} function evaluates the given dates in the context
@@ -41,15 +43,22 @@
isEndOfMonth(calendar="TARGET", dates=Sys.Date())
getEndOfMonth(calendar="TARGET", dates=Sys.Date())
endOfMonth(calendar="TARGET", dates=Sys.Date())
+getHolidayList(calendar="TARGET", from=Sys.Date(), to = Sys.Date() + 5, includeWeekends = 0)
+holidayList(calendar="TARGET", from=Sys.Date(), to = Sys.Date() + 5, includeWeekends = 0)
}
\arguments{
\item{calendar}{A string identifying one of the supported QuantLib
calendars, see Details for more}
\item{dates}{A vector (or scalar) of \code{Date} types.}
+ \item{from}{A vector (or scalar) of \code{Date} types.}
+ \item{to}{A vector (or scalar) of \code{Date} types.}
+ \item{includeWeekends}{boolean that indicates whether the calculation
+ should include the weekends. Default = false}
}
\value{
- An named vector of booleans each of which is true if the corresponding
- date is a business day in the given calendar. The element names are
+ A named vector of booleans each of which is true if the corresponding
+ date is a business day (or holiday or weekend) in the given calendar.
+ The element names are
the dates (formatted as text in yyyy-mm-dd format).
}
\details{
@@ -104,6 +113,12 @@
getEndMonth("UnitedStates/NYSE", dates) ## stocks
getEndMonth("UnitedStates/GovernmentBond", dates) ## bonds
getEndMonth("UnitedStates/NERC", dates) ## energy
+
+ from <- as.Date("2009-04-07")
+ to<-as.Date("2009-04-14")
+ getHolidayList("UnitedStates", from, to)
+ to <- as.Date("2009-10-7")
+ getHolidayList("UnitedStates", from, to)
}
\keyword{misc}
Deleted: pkg/RQuantLib/man/holidayList.Rd
===================================================================
--- pkg/RQuantLib/man/holidayList.Rd 2010-08-02 22:09:57 UTC (rev 284)
+++ pkg/RQuantLib/man/holidayList.Rd 2010-08-02 22:19:16 UTC (rev 285)
@@ -1,55 +0,0 @@
-% $Id: Calendars.Rd 64 2009-04-10 20:24:33Z edd $
-\name{holidayList}
-\alias{holidayList}
-\title{Calendar functions from QuantLib}
-\description{
-The \code{holidayList} function evaluates two given dates in the context
-of the given calendar, and returns a vector that gives the list of holiday
-between.
-}
-\usage{
-holidayList(calendar="TARGET", from=Sys.Date(),
-to = Sys.Date() + 5, includeWeekends = 0)
-}
-\arguments{
- \item{calendar}{A string identifying one of the supported QuantLib
- calendars, see Details for more}
- \item{from}{A vector (or scalar) of \code{Date} types.}
- \item{to}{A vector (or scalar) of \code{Date} types.}
- \item{includeWeekends}{boolean that indicates whether the calculation
- should include the weekends. Default = false}
-}
-\value{
- An vector of dates.
-}
-\details{
- The calendars are coming from QuantLib, and the QuantLib documentation
- should be consulted for details.
-
- Currently, the following strings are recognised: TARGET (a default
- calendar), Canada and Canada/Settlement, Canada/TSX, Germany and
- Germany/FrankfurtStockExchange, Germany/Settlement, Germany/Xetra,
- Germany/Eurex, Italy and Italy/Settlement, Italy/Exchange, Japan,
- UnitedKingdom and UnitedKingdom/Settlement, UnitedKingdom/Exchange,
- UnitedKingdom/Metals, UnitedStates and UnitedStates/Settlement,
- UnitedStates/NYSE, UnitedStates/GovernmentBond, UnitedStates/NERC.
-
- (In case of multiples entries per country, the country default is listed
- right after the country itself. Using the shorter form is equivalent.)
-
-}
-\references{\url{http://quantlib.org} for details on \code{QuantLib}.}
-\author{Dirk Eddelbuettel \email{edd at debian.org} for the \R interface;
- Khanh Nguyen \email{nguyen.h.khanh at gmail.com} for the implementation;
- the QuantLib Group for \code{QuantLib}}
-\note{The interface might change in future release as \code{QuantLib}
- stabilises its own API.}
-\examples{
- from <- as.Date("2009-04-07")
-to<-as.Date("2009-04-14")
-holidayList("UnitedStates", from, to)
-to <- as.Date("2009-10-7")
-holidayList("UnitedStates", from, to)
-}
-\keyword{misc}
-
More information about the Rquantlib-commits
mailing list