[Blotter-commits] r806 - in pkg/FinancialInstrument: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Sep 29 02:09:05 CEST 2011
Author: gsee
Date: 2011-09-29 02:09:05 +0200 (Thu, 29 Sep 2011)
New Revision: 806
Modified:
pkg/FinancialInstrument/NAMESPACE
pkg/FinancialInstrument/R/MonthCodes.R
pkg/FinancialInstrument/R/format_id.R
pkg/FinancialInstrument/man/C2M.Rd
pkg/FinancialInstrument/man/month_cycle2numeric.Rd
Log:
alias MC2N for function month_cycle2numeric
Modified: pkg/FinancialInstrument/NAMESPACE
===================================================================
--- pkg/FinancialInstrument/NAMESPACE 2011-09-28 17:42:10 UTC (rev 805)
+++ pkg/FinancialInstrument/NAMESPACE 2011-09-29 00:09:05 UTC (rev 806)
@@ -28,6 +28,7 @@
export(load.instruments)
export(M2C)
export(make_spread_id)
+export(MC2N)
export(month_cycle2numeric)
export(next.future_id)
export(option)
Modified: pkg/FinancialInstrument/R/MonthCodes.R
===================================================================
--- pkg/FinancialInstrument/R/MonthCodes.R 2011-09-28 17:42:10 UTC (rev 805)
+++ pkg/FinancialInstrument/R/MonthCodes.R 2011-09-29 00:09:05 UTC (rev 806)
@@ -8,6 +8,7 @@
#' @param month Abbreviated month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, or dec
#' @return corresponding code or month.
#' @author Garrett See
+#' @seealso \code{\link{MC2N}}
#' @examples
#' C2M()
#' C2M("M")
Modified: pkg/FinancialInstrument/R/format_id.R
===================================================================
--- pkg/FinancialInstrument/R/format_id.R 2011-09-28 17:42:10 UTC (rev 805)
+++ pkg/FinancialInstrument/R/format_id.R 2011-09-29 00:09:05 UTC (rev 806)
@@ -72,9 +72,10 @@
#'
#' This will convert month codes or month names to numeric months.
#'
-#' Input can be a vector or a comma-delimited string
+#' Input can be a vector or a comma-delimited string. All elements of \code{month_cycle} should be similar.
+#' Do not mix month names, codes and numbers in the same call.
#' @return numeric vector
-#' @param month_cycle the expiration months of a \code{link{future}}. See examples.
+#' @param month_cycle the expiration months of a \code{\link{future}}. See examples.
#' @author Garrett See
#' @seealso \code{\link{M2C}}, \code{\link{C2M}}, \code{\link{next.future_id}}
#' \code{\link{future}}
@@ -85,6 +86,7 @@
#' month_cycle2numeric("March,june,sep,decem")
#' month_cycle2numeric("3,6,9,12")
#' month_cycle2numeric(seq(3,12,3))
+#' @rdname month_cycle2numeric
#' @export
month_cycle2numeric <- function(month_cycle) {
if (is.character(month_cycle)) {
@@ -99,6 +101,10 @@
month_cycle
}
+#' @rdname month_cycle2numeric
+#' @export
+MC2N <- month_cycle2numeric
+
# @examples
# month_cycle2code('feb,apr,jun,aug,dec')
month_cycle2code <- function(month_cycle) {
Modified: pkg/FinancialInstrument/man/C2M.Rd
===================================================================
--- pkg/FinancialInstrument/man/C2M.Rd 2011-09-28 17:42:10 UTC (rev 805)
+++ pkg/FinancialInstrument/man/C2M.Rd 2011-09-29 00:09:05 UTC (rev 806)
@@ -33,4 +33,7 @@
\author{
Garrett See
}
+\seealso{
+ \code{\link{MC2N}}
+}
Modified: pkg/FinancialInstrument/man/month_cycle2numeric.Rd
===================================================================
--- pkg/FinancialInstrument/man/month_cycle2numeric.Rd 2011-09-28 17:42:10 UTC (rev 805)
+++ pkg/FinancialInstrument/man/month_cycle2numeric.Rd 2011-09-29 00:09:05 UTC (rev 806)
@@ -1,12 +1,15 @@
\name{month_cycle2numeric}
+\alias{MC2N}
\alias{month_cycle2numeric}
\title{coerce month_cycle to a numeric vector}
\usage{
month_cycle2numeric(month_cycle)
+
+ MC2N(month_cycle)
}
\arguments{
\item{month_cycle}{the expiration months of a
- \code{link{future}}. See examples.}
+ \code{\link{future}}. See examples.}
}
\value{
numeric vector
@@ -16,7 +19,9 @@
months.
}
\details{
- Input can be a vector or a comma-delimited string
+ Input can be a vector or a comma-delimited string. All
+ elements of \code{month_cycle} should be similar. Do not
+ mix month names, codes and numbers in the same call.
}
\examples{
month_cycle2numeric("H,M,U,Z")
More information about the Blotter-commits
mailing list