[Quantmod-commits] r591 - in pkg: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Dec 27 15:37:55 CET 2012
Author: bodanker
Date: 2012-12-27 15:37:55 +0100 (Thu, 27 Dec 2012)
New Revision: 591
Modified:
pkg/R/addTA.R
pkg/R/addVo.R
pkg/R/attachSymbols.R
pkg/R/buildModel.methods.R
pkg/R/chartSeries.R
pkg/R/chartSeries.chob.R
pkg/R/getFinancials.R
pkg/R/getQuote.R
pkg/R/loadSymbols.R
pkg/man/chart_Series.Rd
pkg/man/getFX.Rd
Log:
- fixed partial argument matching notes from R CMD check
- fixed codoc mismatches in getFX and chart_Series
Modified: pkg/R/addTA.R
===================================================================
--- pkg/R/addTA.R 2012-12-23 11:36:55 UTC (rev 590)
+++ pkg/R/addTA.R 2012-12-27 14:37:55 UTC (rev 591)
@@ -1022,7 +1022,7 @@
paste(x at params$fast,x at params$slow,x at params$signal,sep=','),"):", sep = ""),
paste("MACD:",sprintf("%.3f",last(macd[,1]))),
paste("Signal:",sprintf("%.3f",last(macd[,2])))),
- text.col=c(x at params$colors$fg.col, col[3], col[4]), bty='n', y.inter=0.95)
+ text.col=c(x at params$colors$fg.col, col[3], col[4]), bty='n', y.intersp=0.95)
# text(0, last(y.range)*.9,
# paste("Moving Average Convergence Divergence (",
# paste(x at params$fast,x at params$slow,x at params$signal,sep=','),"):", sep = ""),
@@ -1311,7 +1311,7 @@
ma.tmp <- cbind(ma.tmp,ma)
}
- chobTA at TA.values <- matrix(ma.tmp[lchob at xsubset,],nc=NCOL(ma.tmp))
+ chobTA at TA.values <- matrix(ma.tmp[lchob at xsubset,],ncol=NCOL(ma.tmp))
chobTA at name <- "chartEMA"
chobTA at call <- match.call()
@@ -1415,7 +1415,7 @@
ma.tmp <- cbind(ma.tmp,ma)
}
- chobTA at TA.values <- matrix(ma.tmp[lchob at xsubset,],nc=NCOL(ma.tmp)) # single numeric vector
+ chobTA at TA.values <- matrix(ma.tmp[lchob at xsubset,],ncol=NCOL(ma.tmp)) # single numeric vector
chobTA at name <- "chartSMA"
chobTA at call <- match.call()
chobTA at on <- on # used for deciding when to draw...
@@ -1879,14 +1879,14 @@
# get.current.chob {{{
`get.current.chob` <- function() {
- first.chob <- which(sapply(sys.frames(),function(x) exists('chob',env=x)))[1]
+ first.chob <- which(sapply(sys.frames(),function(x) exists('chob',envir=x)))[1]
if(!is.na(first.chob)) {
- lchob <- get('chob',env=first.chob)
+ lchob <- get('chob',envir=first.chob)
-# if(exists('chob',env=sys.frames()[[sys.parent()]])) {
+# if(exists('chob',envir=sys.frames()[[sys.parent()]])) {
# if(identical(sys.frames()[[sys.parent()]],.GlobalEnv))
# stop("why are you calling this directly?")
-# lchob <- get('chob',env=sys.frames()[[sys.parent()]])
+# lchob <- get('chob',envir=sys.frames()[[sys.parent()]])
} else {
gchob <- get.chob()
#protect against NULL device or windows not drawn to yet
Modified: pkg/R/addVo.R
===================================================================
--- pkg/R/addVo.R 2012-12-23 11:36:55 UTC (rev 590)
+++ pkg/R/addVo.R 2012-12-27 14:37:55 UTC (rev 591)
@@ -130,7 +130,7 @@
))
legend("topleft",
legend=c(paste("Volume (",vol.scale[[2]],"):",sep=''),format(last(Volumes)*vol.scale[[1]],big.mark=',')),
- text.col=c(x at params$colors$fg.col, last(bar.col)), bty="n", y.inter=0.95)
+ text.col=c(x at params$colors$fg.col, last(bar.col)), bty="n", y.intersp=0.95)
# text(0, max(Volumes,na.rm=TRUE) * .9, "Volume:",pos=4)
# text(0, max(Volumes,na.rm=TRUE) * .9,
Modified: pkg/R/attachSymbols.R
===================================================================
--- pkg/R/attachSymbols.R 2012-12-23 11:36:55 UTC (rev 590)
+++ pkg/R/attachSymbols.R 2012-12-27 14:37:55 UTC (rev 591)
@@ -3,7 +3,7 @@
tmp <- file.path(cache.dir,'nasdaqlisted.txt')
NASDAQ <- "http://ftp.nasdaqtrader.com/dynamic/SymDir/nasdaqlisted.txt"
if(!file.exists(tmp))
- download.file(NASDAQ, dest=tmp,quiet=!verbose)
+ download.file(NASDAQ, destfile=tmp,quiet=!verbose)
NQ <- read.delim(tmp,sep="|",stringsAsFactors=FALSE)
test_issues <- which(NQ[,4] != "N")
NQ <- NQ[-test_issues,]
@@ -13,7 +13,7 @@
tmp <- file.path(cache.dir,'otherlisted.txt')
OTHER <- "http://ftp.nasdaqtrader.com/dynamic/SymDir/otherlisted.txt"
if(!file.exists(tmp))
- download.file(OTHER, dest=tmp, quiet=!verbose)
+ download.file(OTHER, destfile=tmp, quiet=!verbose)
OT <- read.delim(tmp,sep="|",stringsAsFactors=FALSE)
test_issues <- which(OT[,7] != "N")
@@ -58,8 +58,8 @@
if(mem.cache) {
envir <- as.environment(envir)
delayedAssign(lsym(s), {
- assign(lsym(s),getSymbols(rsym(s),auto.assign=FALSE, src=gsrc, ...), env=envir)
- get(lsym(s), env=envir) },
+ assign(lsym(s),getSymbols(rsym(s),auto.assign=FALSE, src=gsrc, ...), envir=envir)
+ get(lsym(s), envir=envir) },
assign.env=envir)
} else { # no cache
f <- function(value) {
Modified: pkg/R/buildModel.methods.R
===================================================================
--- pkg/R/buildModel.methods.R 2012-12-23 11:36:55 UTC (rev 590)
+++ pkg/R/buildModel.methods.R 2012-12-27 14:37:55 UTC (rev 591)
@@ -244,7 +244,7 @@
function(method,package)
{
if(!package %in% .packages()) {
- if(package %in% .packages(all=TRUE)) {
+ if(package %in% .packages(all.available=TRUE)) {
cat(paste("loading required package:",package,"\n"))
library(package,character.only=TRUE)
} else {
Modified: pkg/R/chartSeries.R
===================================================================
--- pkg/R/chartSeries.R 2012-12-23 11:36:55 UTC (rev 590)
+++ pkg/R/chartSeries.R 2012-12-27 14:37:55 UTC (rev 591)
@@ -108,7 +108,7 @@
x.labels <- format(index(x)[ep + 1], "%b %d%n%H:%M")
chob <- new("chob")
- chob at call <- match.call(expand=TRUE)
+ chob at call <- match.call(expand.dots=TRUE)
if(is.null(name)) name <- as.character(match.call()$x)
chob at xdata <- xdata
@@ -137,7 +137,7 @@
chob at length <- NROW(x)
- chob at passed.args <- as.list(match.call(expand=TRUE)[-1])
+ chob at passed.args <- as.list(match.call(expand.dots=TRUE)[-1])
if(!is.null(TA)) {
# important to force eval of _current_ chob, not saved chob
@@ -146,8 +146,8 @@
chob at passed.args$TA <- list()
for(ta in 1:length(TA)) {
if(is.character(TA[[ta]])) {
- chob at passed.args$TA[[ta]] <- eval(parse(text=TA[[ta]]),env=thisEnv)
- } else chob at passed.args$TA[[ta]] <- eval(TA[[ta]],env=thisEnv)
+ chob at passed.args$TA[[ta]] <- eval(parse(text=TA[[ta]]),envir=thisEnv)
+ } else chob at passed.args$TA[[ta]] <- eval(TA[[ta]],envir=thisEnv)
}
chob at windows <- length(which(sapply(chob at passed.args$TA,function(x) x at new)))+1
chob at passed.args$show.vol <- any(sapply(chob at passed.args$TA,function(x) x at name=="chartVo"))
@@ -474,7 +474,7 @@
x.labels <- names(ep)
chob <- new("chob")
- chob at call <- match.call(expand=TRUE)
+ chob at call <- match.call(expand.dots=TRUE)
if(is.null(name)) name <- as.character(match.call()$x)
chob at xdata <- xdata
@@ -509,7 +509,7 @@
chob at length <- NROW(x)
- chob at passed.args <- as.list(match.call(expand=TRUE)[-1])
+ chob at passed.args <- as.list(match.call(expand.dots=TRUE)[-1])
if(!is.null(TA)) {
# important to force eval of _current_ chob, not saved chob
@@ -520,8 +520,8 @@
#if(length(TA) > 0) {
for(ta in 1:length(TA)) {
if(is.character(TA[[ta]])) {
- chob at passed.args$TA[[ta]] <- eval(parse(text=TA[[ta]]),env=thisEnv)
- } else chob at passed.args$TA[[ta]] <- eval(TA[[ta]],env=thisEnv)
+ chob at passed.args$TA[[ta]] <- eval(parse(text=TA[[ta]]),envir=thisEnv)
+ } else chob at passed.args$TA[[ta]] <- eval(TA[[ta]],envir=thisEnv)
}
# check if all args are indeed chobTA
poss.new <- sapply(chob at passed.args$TA, function(x)
Modified: pkg/R/chartSeries.chob.R
===================================================================
--- pkg/R/chartSeries.chob.R 2012-12-23 11:36:55 UTC (rev 590)
+++ pkg/R/chartSeries.chob.R 2012-12-27 14:37:55 UTC (rev 591)
@@ -184,7 +184,7 @@
for(indicator in 1:length(main.key)) {
legend("topleft",
legend=c(rep('',indicator-1), paste(main.key[[indicator]][["legend"]],collapse="")),
- text.col=rev(main.key[[indicator]][["text.col"]])[1], bty='n', y.inter=0.95)
+ text.col=rev(main.key[[indicator]][["text.col"]])[1], bty='n', y.intersp=0.95)
}
}
main.key <- list()
@@ -217,7 +217,7 @@
for(indicator in (length(main.key)-length(underlay.text)):length(main.key)) {
legend("topleft",
legend=c(rep('',indicator-1), paste(main.key[[indicator]][["legend"]],collapse="")),
- text.col=rev(main.key[[indicator]][["text.col"]])[1], bty='n', y.inter=0.95)
+ text.col=rev(main.key[[indicator]][["text.col"]])[1], bty='n', y.intersp=0.95)
}
}
} else
Modified: pkg/R/getFinancials.R
===================================================================
--- pkg/R/getFinancials.R 2012-12-23 11:36:55 UTC (rev 590)
+++ pkg/R/getFinancials.R 2012-12-27 14:37:55 UTC (rev 591)
@@ -35,7 +35,7 @@
}
fin <- lapply(1:6,
function(x) {
- structure(matrix(vals[[x]],nr=length(fnames[[x]]),byrow=TRUE),
+ structure(matrix(vals[[x]],nrow=length(fnames[[x]]),byrow=TRUE),
.Dimnames=list(fnames[[x]],make_col_names(cnames[[x]])),
col_desc=cnames[[x]])})
fin <- list(IS=list(Q=fin[[1]], A=fin[[2]]),
@@ -136,14 +136,14 @@
# remove empty columns
ret$IS$Q <- ret$IS$Q[,apply(ret$IS$Q,2,function(x) all(x != ''))]
# create numeric matrix with appropriate row and col names
- ret$IS$Q <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$IS$Q[,-1]))),nr=49),
+ ret$IS$Q <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$IS$Q[,-1]))),nrow=49),
dimnames=list(ret$IS$Q[,1],gsub('.*(\\d{4}-\\d{2}-\\d{2})','\\1',colnamesISCF[[1]],perl=TRUE)))
# Income Statement Annual
# remove empty columns
ret$IS$A <- ret$IS$A[,apply(ret$IS$A,2,function(x) all(x != ''))]
# create numeric matrix with appropriate row and col names
- ret$IS$A <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$IS$A[,-1]))),nr=49),
+ ret$IS$A <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$IS$A[,-1]))),nrow=49),
dimnames=list(ret$IS$A[,1],gsub('.*(\\d{4}-\\d{2}-\\d{2})','\\1',colnamesISCF[[2]],perl=TRUE)))
# identify the colnames for BS
@@ -155,28 +155,28 @@
# remove empty columns
ret$BS$Q <- ret$BS$Q[,apply(ret$BS$Q,2,function(x) all(x != ''))]
# create numeric matrix with appropriate row and col names
- ret$BS$Q <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$BS$Q[,-1]))),nr=40),
+ ret$BS$Q <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$BS$Q[,-1]))),nrow=40),
dimnames=list(ret$BS$Q[,1],gsub('.*(\\d{4}-\\d{2}-\\d{2})','\\1',colnamesBS[[1]],perl=TRUE)))
# Balance Sheet Annual
# remove empty columns
ret$BS$A <- ret$BS$A[,apply(ret$BS$A,2,function(x) all(x != ''))]
# create numeric matrix with appropriate row and col names
- ret$BS$A <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$BS$A[,-1]))),nr=40),
+ ret$BS$A <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$BS$A[,-1]))),nrow=40),
dimnames=list(ret$BS$A[,1],gsub('.*(\\d{4}-\\d{2}-\\d{2})','\\1',colnamesBS[[2]],perl=TRUE)))
# Cash Flow Quarters
# remove empty columns
ret$CF$Q <- ret$CF$Q[,apply(ret$CF$Q,2,function(x) all(x != ''))]
# create numeric matrix with appropriate row and col names
- ret$CF$Q <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$CF$Q[,-1]))),nr=19),
+ ret$CF$Q <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$CF$Q[,-1]))),nrow=19),
dimnames=list(ret$CF$Q[,1],gsub('.*(\\d{4}-\\d{2}-\\d{2})','\\1',colnamesISCF[[3]],perl=TRUE)))
# Cash Flow Annual
# remove empty columns
ret$CF$A <- ret$CF$A[,apply(ret$CF$A,2,function(x) all(x != ''))]
# create numeric matrix with appropriate row and col names
- ret$CF$A <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$CF$A[,-1]))),nr=19),
+ ret$CF$A <- structure(matrix(as.numeric(gsub('^-$','',as.matrix(ret$CF$A[,-1]))),nrow=19),
dimnames=list(ret$CF$A[,1],gsub('.*(\\d{4}-\\d{2}-\\d{2})','\\1',colnamesISCF[[4]],perl=TRUE)))
if(auto.assign) {
Modified: pkg/R/getQuote.R
===================================================================
--- pkg/R/getQuote.R 2012-12-23 11:36:55 UTC (rev 590)
+++ pkg/R/getQuote.R 2012-12-27 14:37:55 UTC (rev 591)
@@ -47,7 +47,7 @@
"http://finance.yahoo.com/d/quotes.csv?s=",
Symbols,
"&f=",QF,sep=""),
- dest=tmp,quiet=TRUE)
+ destfile=tmp,quiet=TRUE)
sq <- read.csv(file=tmp,sep=',',stringsAsFactors=FALSE,header=FALSE)
unlink(tmp)
Qposix <- strptime(paste(sq[,1],sq[,2]),format='%m/%d/%Y %H:%M')
Modified: pkg/R/loadSymbols.R
===================================================================
--- pkg/R/loadSymbols.R 2012-12-23 11:36:55 UTC (rev 590)
+++ pkg/R/loadSymbols.R 2012-12-27 14:37:55 UTC (rev 591)
@@ -59,8 +59,8 @@
which(exp.codes==right,TRUE)[,1])]
strike.codes <- rbind(
- matrix(rep(c(0,100,200,300,400,500),20),nr=20,byrow=TRUE)+seq(5,100,5),
- matrix(rep(seq(0,150,30),6),nr=6,byrow=TRUE)+seq(7.5,32.5,5))
+ matrix(rep(c(0,100,200,300,400,500),20),nrow=20,byrow=TRUE)+seq(5,100,5),
+ matrix(rep(seq(0,150,30),6),nrow=6,byrow=TRUE)+seq(7.5,32.5,5))
strike.code <- LETTERS[which(strike.codes==strike,TRUE)[,1]]
if(src=='yahoo') src <- ".X"
Modified: pkg/man/chart_Series.Rd
===================================================================
--- pkg/man/chart_Series.Rd 2012-12-23 11:36:55 UTC (rev 590)
+++ pkg/man/chart_Series.Rd 2012-12-27 14:37:55 UTC (rev 591)
@@ -31,7 +31,8 @@
TA = "",
pars = chart_pars(),
theme = chart_theme(),
- clev = 0)
+ clev = 0,
+ ...)
}
\arguments{
\item{x}{
@@ -58,7 +59,10 @@
\item{clev}{
color level (experimental). Indicates the degree of brightness 0 is darkest color.
}
+ \item{\dots}{
+additional parameters
}
+}
\details{
These functions, when complete, will revert back to the original chartSeries naming
convention.
Modified: pkg/man/getFX.Rd
===================================================================
--- pkg/man/getFX.Rd 2012-12-23 11:36:55 UTC (rev 590)
+++ pkg/man/getFX.Rd 2012-12-27 14:37:55 UTC (rev 591)
@@ -7,7 +7,7 @@
}
\usage{
getFX(Currencies,
- from = Sys.Date() - 500,
+ from = Sys.Date() - 499,
to = Sys.Date(),
env = .GlobalEnv,
verbose = FALSE,
More information about the Quantmod-commits
mailing list