[Quantmod-commits] r606 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 23 20:09:20 CEST 2013


Author: bodanker
Date: 2013-05-23 20:09:19 +0200 (Thu, 23 May 2013)
New Revision: 606

Modified:
   pkg/R/getFinancials.R
   pkg/R/getOptionChain.R
   pkg/R/getSymbols.R
Log:
- add warn=FALSE to readLines calls, thanks to Garrett See


Modified: pkg/R/getFinancials.R
===================================================================
--- pkg/R/getFinancials.R	2013-05-06 21:35:54 UTC (rev 605)
+++ pkg/R/getFinancials.R	2013-05-23 18:09:19 UTC (rev 606)
@@ -10,7 +10,7 @@
   google.fin <- "http://finance.google.com/finance?fstype=ii&q=" 
   tmp <- tempfile()
   download.file(paste(google.fin,Symbol,sep=""),quiet=TRUE,destfile=tmp)
-  Symbol <- readLines(tmp)
+  Symbol <- readLines(tmp, warn=FALSE)
 
   # thead contains the column names
   # tbody contains the data
@@ -62,7 +62,7 @@
   download.file(paste('http://finance.google.com/finance?fstype=ii&q=',Symbol,sep=''),
                 quiet=TRUE,destfile=tmp)
   Symbol.name <- Symbol
-  Symbol <- readLines(tmp)
+  Symbol <- readLines(tmp, warn=FALSE)
 
   # strip all html and commas
   symbol <- gsub('( )|(<.*?>)|(,)','',Symbol,perl=TRUE)

Modified: pkg/R/getOptionChain.R
===================================================================
--- pkg/R/getOptionChain.R	2013-05-06 21:35:54 UTC (rev 605)
+++ pkg/R/getOptionChain.R	2013-05-23 18:09:19 UTC (rev 606)
@@ -50,9 +50,9 @@
   }
 
   if(missing(Exp))
-    opt <- readLines(paste(paste("http://finance.yahoo.com/q/op?s",Symbols,sep="="),"Options",sep="+"))
+    opt <- readLines(paste(paste("http://finance.yahoo.com/q/op?s",Symbols,sep="="),"Options",sep="+"), warn=FALSE)
   else
-    opt <- readLines(paste(paste("http://finance.yahoo.com/q/op?s=",Symbols,"&m=",parse.expiry(Exp),sep=""),"Options",sep="+"))
+    opt <- readLines(paste(paste("http://finance.yahoo.com/q/op?s=",Symbols,"&m=",parse.expiry(Exp),sep=""),"Options",sep="+"), warn=FALSE)
   opt <- opt[grep("Expire at",opt)]
   opt <- gsub("%5E","",opt)
 

Modified: pkg/R/getSymbols.R
===================================================================
--- pkg/R/getSymbols.R	2013-05-06 21:35:54 UTC (rev 605)
+++ pkg/R/getSymbols.R	2013-05-23 18:09:19 UTC (rev 606)
@@ -287,6 +287,7 @@
          fr[,3] <- fr[,3] * adj[,'Split'] * adj[,'Div']  # Low
          fr[,4] <- fr[,4] * adj[,'Split'] * adj[,'Div']  # Close
          fr[,5] <- fr[,5] * ( 1 / adj[,'Div'] )          # Volume
+         #fr <- adjustOHLC(fr, symbol.name=Symbols.name)
        }
 
        fr <- convert.time.series(fr=fr,return.class=return.class)
@@ -920,7 +921,7 @@
                        "&expr2=",currency.pair[2],
                        "&margin_fixed=0&SUBMIT=Get+Table&format=CSV&redirected=1",
                        sep=""),destfile=tmp,quiet=!verbose)
-       fr <- readLines(tmp)
+       fr <- readLines(tmp, warn=FALSE)
        unlink(tmp)
        fr <- unlist(strsplit(
                     gsub("<PRE>|</PRE>","",fr[(grep("PRE",fr)[1]):(grep("PRE",fr)[2])]),","))



More information about the Quantmod-commits mailing list