[Rquantlib-commits] r284 - in pkg/RQuantLib: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 3 00:09:57 CEST 2010


Author: edd
Date: 2010-08-03 00:09:57 +0200 (Tue, 03 Aug 2010)
New Revision: 284

Removed:
   pkg/RQuantLib/man/endOfMonth.Rd
   pkg/RQuantLib/man/isEndOfMonth.Rd
Modified:
   pkg/RQuantLib/R/calendars.R
   pkg/RQuantLib/man/Calendars.Rd
Log:
folded endOfMonth.Rd, isEndOfMonth.Rd into Calendars.Rd
copied endOfMonth() into getEndOfMonth(), old form still allowed


Modified: pkg/RQuantLib/R/calendars.R
===================================================================
--- pkg/RQuantLib/R/calendars.R	2010-08-02 21:59:16 UTC (rev 283)
+++ pkg/RQuantLib/R/calendars.R	2010-08-02 22:09:57 UTC (rev 284)
@@ -60,7 +60,7 @@
     val
 }
 
-endOfMonth <- function(calendar="TARGET", dates=Sys.Date()) {
+getEndOfMonth <- function(calendar="TARGET", dates=Sys.Date()) {
     stopifnot(is.character(calendar))
     stopifnot(class(dates)=="Date")
     val <- .Call("QL_endOfMonth", calendar, dates, PACKAGE="RQuantLib")
@@ -68,6 +68,10 @@
     val
 }
 
+endOfMonth <- function(calendar="TARGET", dates=Sys.Date()) {
+    getEndOfMonth(calendar, dates)
+}
+
 adjust <- function(calendar="TARGET", dates=Sys.Date(), bdc = 0 ) {
     stopifnot(is.character(calendar))
     stopifnot(class(dates)=="Date")

Modified: pkg/RQuantLib/man/Calendars.Rd
===================================================================
--- pkg/RQuantLib/man/Calendars.Rd	2010-08-02 21:59:16 UTC (rev 283)
+++ pkg/RQuantLib/man/Calendars.Rd	2010-08-02 22:09:57 UTC (rev 284)
@@ -4,29 +4,43 @@
 \alias{businessDay}
 \alias{isHoliday}
 \alias{isWeekend}
+\alias{isEndOfMonth}
+\alias{getEndOfMonth}
+\alias{endOfMonth}
 \title{Calendar functions from QuantLib}
 \description{
 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.
 
-The form \code{BusinessDay} is also recognised (but may be deprecated
-one day).
-
 The \code{isHoliday} function evaluates the given dates in the context
 of the given calendar, and returns a vector of booleans indicating
-holiday day status.}
+holiday day status.
 
 The \code{isWeekend} function evaluates the given dates in the context
 of the given calendar, and returns a vector of booleans indicating
-weekend status.}
+weekend status.
 
+The \code{isEndOfMonth} function evaluates the given dates in the context
+of the given calendar, and returns a vector of booleans indicating
+end of month status.
+
+The \code{getEndOfMonth} function evaluates the given dates in the context
+of the given calendar, and returns a vector that corresponds to the end
+of month. \code{endOfMonth} is a deprecated form for this function.
+
+The variants \code{BusinessDay} is are also
+recognised (but may be deprecated one day).
+
 }
 \usage{
 isBusinessDay(calendar="TARGET", dates=Sys.Date())
 businessDay(calendar="TARGET", dates=Sys.Date())  # deprecated form
 isHoliday(calendar="TARGET", dates=Sys.Date())
 isWeekend(calendar="TARGET", dates=Sys.Date())
+isEndOfMonth(calendar="TARGET", dates=Sys.Date())
+getEndOfMonth(calendar="TARGET", dates=Sys.Date())
+endOfMonth(calendar="TARGET", dates=Sys.Date())
 }
 \arguments{
   \item{calendar}{A string identifying one of the supported QuantLib
@@ -78,6 +92,18 @@
   isWeekend("UnitedStates/NYSE", dates)            ## stocks
   isWeekend("UnitedStates/GovernmentBond", dates)  ## bonds
   isWeekend("UnitedStates/NERC", dates)            ## energy
+
+  isEndOfMonth("UnitedStates", dates)
+  isEndOfMonth("UnitedStates/Settlement", dates)      ## same as previous
+  isEndOfMonth("UnitedStates/NYSE", dates)            ## stocks
+  isEndOfMonth("UnitedStates/GovernmentBond", dates)  ## bonds
+  isEndOfMonth("UnitedStates/NERC", dates)            ## energy
+
+  getEndMonth("UnitedStates", dates)
+  getEndMonth("UnitedStates/Settlement", dates)      ## same as previous
+  getEndMonth("UnitedStates/NYSE", dates)            ## stocks
+  getEndMonth("UnitedStates/GovernmentBond", dates)  ## bonds
+  getEndMonth("UnitedStates/NERC", dates)            ## energy
 }
 \keyword{misc}
 

Deleted: pkg/RQuantLib/man/endOfMonth.Rd
===================================================================
--- pkg/RQuantLib/man/endOfMonth.Rd	2010-08-02 21:59:16 UTC (rev 283)
+++ pkg/RQuantLib/man/endOfMonth.Rd	2010-08-02 22:09:57 UTC (rev 284)
@@ -1,53 +0,0 @@
-% $Id: Calendars.Rd 64 2009-04-10 20:24:33Z edd $
-\name{endOfMonth}
-\alias{endOfMonth}
-\title{Calendar functions from QuantLib}
-\description{
-The \code{endOfMonth} function evaluates the given dates in the context
-of the given calendar, and returns a vector that corresponds to the end
-of month.}
-\usage{
-endOfMonth(calendar="TARGET", dates=Sys.Date())
-}
-\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.}
-}
-\value{
-  An named vector of dates, each of which is the end of month date that
-  corresponds to the input dates.  The element names are
-  the dates (formatted as text in yyyy-mm-dd format).
-}
-\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{
-  dates <- seq(from=as.Date("2009-04-07"), to=as.Date("2009-04-14"), by=1)
-  endOfMonth("UnitedStates", dates)
-  endOfMonth("UnitedStates/Settlement", dates)      ## same as previous
-  endOfMonth("UnitedStates/NYSE", dates)            ## stocks
-  endOfMonth("UnitedStates/GovernmentBond", dates)  ## bonds
-  endOfMonth("UnitedStates/NERC", dates)            ## energy
-}
-\keyword{misc}
-

Deleted: pkg/RQuantLib/man/isEndOfMonth.Rd
===================================================================
--- pkg/RQuantLib/man/isEndOfMonth.Rd	2010-08-02 21:59:16 UTC (rev 283)
+++ pkg/RQuantLib/man/isEndOfMonth.Rd	2010-08-02 22:09:57 UTC (rev 284)
@@ -1,53 +0,0 @@
-% $Id: Calendars.Rd 64 2009-04-10 20:24:33Z edd $
-\name{isEndOfMonth}
-\alias{isEndOfMonth}
-\title{Calendar functions from QuantLib}
-\description{
-The \code{isEndOfMonth} function evaluates the given dates in the context
-of the given calendar, and returns a vector of booleans indicating
-end of month status.}
-\usage{
-isEndOfMonth(calendar="TARGET", dates=Sys.Date())
-}
-\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.}
-}
-\value{
-  An named vector of booleans each of which is true if the corresponding
-  date is an end of month in the given calendar.  The element names are
-  the dates (formatted as text in yyyy-mm-dd format).
-}
-\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{
-  dates <- seq(from=as.Date("2009-04-07"), to=as.Date("2009-04-14"), by=1)
-  isEndOfMonth("UnitedStates", dates)
-  isEndOfMonth("UnitedStates/Settlement", dates)      ## same as previous
-  isEndOfMonth("UnitedStates/NYSE", dates)            ## stocks
-  isEndOfMonth("UnitedStates/GovernmentBond", dates)  ## bonds
-  isEndOfMonth("UnitedStates/NERC", dates)            ## energy
-}
-\keyword{misc}
-



More information about the Rquantlib-commits mailing list