Commit c47d1386 authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

Import Upstream version 0.10-22

parent 658e2fdf
2009-11-22 Kurt Hornik <Kurt.Hornik@wu.ac.at>
* DESCRIPTION (Version): New version is 0.10-22.
* R/finance.R (portfolio.optim.default, get.hist.quote):
Simplify/improve run-time depends.
2009-10-04 Kurt Hornik <Kurt.Hornik@wu.ac.at>
* DESCRIPTION (Version): New version is 0.10-21.
......
Package: tseries
Version: 0.10-21
Date: 2009-10-04
Version: 0.10-22
Date: 2009-11-22
Title: Time series analysis and computational finance
Author: Compiled by Adrian Trapletti <a.trapletti@swissonline.ch>
Maintainer: Kurt Hornik <Kurt.Hornik@R-project.org>
......@@ -9,6 +9,6 @@ Depends: R (>= 2.4.0), quadprog, stats, zoo
Suggests: its
Imports: graphics, stats, utils
License: GPL-2
Packaged: 2009-10-04 18:45:07 UTC; hornik
Packaged: 2009-11-22 19:03:45 UTC; hornik
Repository: CRAN
Date/Publication: 2009-10-04 18:51:22
Date/Publication: 2009-11-22 19:06:50
......@@ -37,8 +37,6 @@ portfolio.optim.default <-
function(x, pm = mean(x), riskless = FALSE, shorts = FALSE,
rf = 0.0, reslow = NULL, reshigh = NULL, covmat = cov(x), ...)
{
if(!require("quadprog", quietly=TRUE))
stop("package", sQuote("quadprog"), "is needed. Stopping")
if(NCOL(x) == 1)
stop("x is not a matrix")
if(any(is.na(x)))
......@@ -231,12 +229,13 @@ function (instrument = "^gdax", start, end,
y <- zoo(x, dat)
y <- y[, seq_along(nser), drop = drop]
if(retclass == "its") {
if("package:its" %in% search() || require("its", quietly = TRUE)) {
index(y) <- as.POSIXct(index(y))
y <- its::as.its(y)
} else {
warning("package its could not be loaded: zoo series returned")
}
if(inherits(tryCatch(getNamespace("its"), error = identity),
"error"))
warning("package its could not be loaded: zoo series returned")
else {
index(y) <- as.POSIXct(index(y))
y <- its::as.its(y)
}
}
return(y)
}
......@@ -309,12 +308,13 @@ function (instrument = "^gdax", start, end,
} else {
y <- zoo(x[[2]], dat)
if(retclass == "its") {
if("package:its" %in% search() || require("its", quietly = TRUE)) {
index(y) <- as.POSIXct(index(y))
y <- its::as.its(y)
} else {
warning("package its could not be loaded: zoo series returned")
}
if(inherits(tryCatch(getNamespace("its"), error = identity),
"error"))
warning("package its could not be loaded: zoo series returned")
else {
index(y) <- as.POSIXct(index(y))
y <- its::as.its(y)
}
}
return(y)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment