[Blotter-commits] r1655 - in pkg/FinancialInstrument: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Nov 23 23:53:26 CET 2014
Author: gsee
Date: 2014-11-23 23:53:26 +0100 (Sun, 23 Nov 2014)
New Revision: 1655
Modified:
pkg/FinancialInstrument/NAMESPACE
pkg/FinancialInstrument/R/FinancialInstrument-package.R
pkg/FinancialInstrument/R/all.equal.instrument.R
pkg/FinancialInstrument/R/expires.R
pkg/FinancialInstrument/R/instrument.R
pkg/FinancialInstrument/R/parse_id.R
pkg/FinancialInstrument/man/all.equal.instrument.Rd
pkg/FinancialInstrument/man/expires.spread.Rd
Log:
remove @S3method, which is deprecated. import from packages in Depends.
Modified: pkg/FinancialInstrument/NAMESPACE
===================================================================
--- pkg/FinancialInstrument/NAMESPACE 2014-11-20 17:37:03 UTC (rev 1654)
+++ pkg/FinancialInstrument/NAMESPACE 2014-11-23 22:53:26 UTC (rev 1655)
@@ -1,6 +1,6 @@
# Generated by roxygen2 (4.0.2): do not edit by hand
-S3method(all.equal,instrument)
+S3method(all,equal.instrument)
S3method(expires,character)
S3method(expires,instrument)
S3method(expires,xts)
@@ -164,3 +164,8 @@
importFrom(quantmod,setSymbolLookup)
importFrom(quantmod,yahooQF)
importFrom(zoo,as.Date)
+importFrom(zoo,as.zoo)
+importFrom(zoo,coredata)
+importFrom(zoo,index)
+importFrom(zoo,is.zoo)
+importFrom(zoo,na.locf)
Modified: pkg/FinancialInstrument/R/FinancialInstrument-package.R
===================================================================
--- pkg/FinancialInstrument/R/FinancialInstrument-package.R 2014-11-20 17:37:03 UTC (rev 1654)
+++ pkg/FinancialInstrument/R/FinancialInstrument-package.R 2014-11-23 22:53:26 UTC (rev 1655)
@@ -4,6 +4,7 @@
#' has.Op has.Ad has.Trade has.Price getPrice Op Cl Ad has.Cl getSymbols
#' getSymbolLookup setSymbolLookup yahooQF has.Vo Vo getOptionChain
#' @importFrom TTR stockSymbols runSum
+#' @importFrom zoo na.locf as.zoo coredata is.zoo index
NULL
#' Construct, manage and store contract specifications for trading
Modified: pkg/FinancialInstrument/R/all.equal.instrument.R
===================================================================
--- pkg/FinancialInstrument/R/all.equal.instrument.R 2014-11-20 17:37:03 UTC (rev 1654)
+++ pkg/FinancialInstrument/R/all.equal.instrument.R 2014-11-23 22:53:26 UTC (rev 1655)
@@ -25,8 +25,6 @@
#' \code{char.n}. Unless \code{collapse} is \code{NULL}, it will be used in a
#' call to \code{\link{paste}}. If \code{collapse} is \code{NULL}, each element
#' of the character vector will be compared separately.
-#' @method all.equal instrument
-#' @S3method all.equal instrument
#' @author Garrett See
#' @seealso \code{\link{getInstrument}}, \code{\link{instrument.table}},
#' \code{\link{buildHierarchy}}
@@ -45,6 +43,7 @@
#'
#' all.equal(getInstrument("DIA"), getInstrument("USD"))
#' }
+#' @export
all.equal.instrument <- function (target, current, char.n=2, collapse=";", ...) {
stopifnot(is.instrument(target))
if (char.n < 0) char.n <- Inf
Modified: pkg/FinancialInstrument/R/expires.R
===================================================================
--- pkg/FinancialInstrument/R/expires.R 2014-11-20 17:37:03 UTC (rev 1654)
+++ pkg/FinancialInstrument/R/expires.R 2014-11-23 22:53:26 UTC (rev 1655)
@@ -81,11 +81,10 @@
#' \code{FALSE} the first one after \code{Date} will be returned. Note that
#' if \code{expires} is a single value, \code{expired} will be ignored.
#' @param silent silence warnings?
-#' @method expires instrument
-#' @S3method expires instrument
#' @seealso \code{\link{expires}}
#' @author Garrett See
#' @keywords internal
+#' @export
expires.instrument <- function(x, Date, expired=TRUE, silent=FALSE, ...) {
if (is.instrument(x)) {
if (missing(Date)) Date <- Sys.Date()
@@ -142,11 +141,10 @@
#' returned will be the last one before \code{Date}. If \code{expired} is
#' \code{FALSE} the first one after \code{Date} will be returned.
#' @param silent silence warnings?
-#' @method expires character
-#' @S3method expires character
#' @seealso \code{\link{expires.instrument}}
#' @author Garrett See
#' @keywords internal
+#' @export
expires.character <- function(x, Date, expired=TRUE, silent=FALSE, ...) {
xi <- getInstrument(x, silent=TRUE)
if (is.instrument(xi)) {
@@ -179,11 +177,10 @@
#' \code{expires} is a vector. If \code{expired} is \code{TRUE} the date
#' returned will be the last one before \code{Date}. If \code{expired} is
#' \code{FALSE} the first one after \code{Date} will be returned.
-#' @method expires character
-#' @S3method expires character
#' @seealso \code{\link{expires.instrument}}
#' @author Garrett See
#' @keywords internal
+#' export
expires.spread <- function(x, Date, expired=TRUE, silent=FALSE, ...) {
if (inherits(x, "spread")) {
if (!is.null(x$expires)) {
@@ -220,11 +217,10 @@
#'
#' If \code{src} is \dQuote{instrument} the symbol of the xts object will
#' be passed to \code{\link{expires.character}}
-#' @method expires xts
-#' @S3method expires xts
#' @seealso \code{\link{expires.instrument}}, \code{\link{expires}}
#' @author Garrett See
#' @keywords internal
+#' @export
expires.xts <- function(x, Date, expired=TRUE, silent=FALSE,
src=c("data", "instrument"), ...) {
src <- c("data", "instrument")[pmatch(src, c("data", "instrument"))[[1L]]]
Modified: pkg/FinancialInstrument/R/instrument.R
===================================================================
--- pkg/FinancialInstrument/R/instrument.R 2014-11-20 17:37:03 UTC (rev 1654)
+++ pkg/FinancialInstrument/R/instrument.R 2014-11-23 22:53:26 UTC (rev 1655)
@@ -1520,10 +1520,9 @@
#' instrument class print method
#'
-#' @method print instrument
-#' @S3method print instrument
#' @author Joshua Ulrich, Garrett See
#' @keywords internal
+#' @export
print.instrument <- function(x, ...) {
str(unclass(x), comp.str="", no.list=TRUE, give.head=FALSE,
give.length=FALSE, give.attr=FALSE, nest.lev=-1, indent.str="")
@@ -1532,10 +1531,9 @@
#' instrument class sort method
#'
-#' @method sort instrument
-#' @S3method sort instrument
#' @author Garrett See
#' @keywords internal
+#' @export
sort.instrument <- function(x, decreasing=FALSE, na.last=NA, ...) {
anchored <- x[c("primary_id", "currency", "multiplier", "tick_size",
"identifiers", "type")]
Modified: pkg/FinancialInstrument/R/parse_id.R
===================================================================
--- pkg/FinancialInstrument/R/parse_id.R 2014-11-20 17:37:03 UTC (rev 1654)
+++ pkg/FinancialInstrument/R/parse_id.R 2014-11-23 22:53:26 UTC (rev 1655)
@@ -452,9 +452,8 @@
#' id.list class print method
#'
-#' @method print id.list
-#' @S3method print id.list
#' @keywords internal
+#' @export
print.id.list <- function(x, ...) {
str(x, comp.str="", give.length=FALSE, give.attr=FALSE)
invisible(x)
@@ -462,9 +461,8 @@
#' suffix.list class print method
#'
-#' @method print suffix.list
-#' @S3method print suffix.list
#' @keywords internal
+#' @export
print.suffix.list <- function(x, ...) {
str(x, comp.str="", give.length=FALSE, give.attr=FALSE)
invisible(x)
Modified: pkg/FinancialInstrument/man/all.equal.instrument.Rd
===================================================================
--- pkg/FinancialInstrument/man/all.equal.instrument.Rd 2014-11-20 17:37:03 UTC (rev 1654)
+++ pkg/FinancialInstrument/man/all.equal.instrument.Rd 2014-11-23 22:53:26 UTC (rev 1655)
@@ -3,7 +3,7 @@
\alias{all.equal.instrument}
\title{instrument all.equal method}
\usage{
-\method{all.equal}{instrument}(target, current, char.n = 2, collapse = ";",
+\method{all}{equal.instrument}(target, current, char.n = 2, collapse = ";",
...)
}
\arguments{
Modified: pkg/FinancialInstrument/man/expires.spread.Rd
===================================================================
--- pkg/FinancialInstrument/man/expires.spread.Rd 2014-11-20 17:37:03 UTC (rev 1654)
+++ pkg/FinancialInstrument/man/expires.spread.Rd 2014-11-23 22:53:26 UTC (rev 1655)
@@ -3,7 +3,7 @@
\alias{expires.spread}
\title{spread expires extraction method}
\usage{
-\method{expires}{character}(x, Date, expired = TRUE, silent = FALSE, ...)
+\method{expires}{spread}(x, Date, expired = TRUE, silent = FALSE, ...)
}
\arguments{
\item{Date}{Can be a Date or character string. When \code{expires} is a
@@ -27,5 +27,6 @@
\seealso{
\code{\link{expires.instrument}}
}
+\keyword{export}
\keyword{internal}
More information about the Blotter-commits
mailing list