[Blotter-commits] r902 - in pkg/FinancialInstrument: R inst/parser
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jan 3 20:46:23 CET 2012
Author: gsee
Date: 2012-01-03 20:46:22 +0100 (Tue, 03 Jan 2012)
New Revision: 902
Modified:
pkg/FinancialInstrument/R/parse_id.R
pkg/FinancialInstrument/inst/parser/TRTH_BackFill.R
Log:
- parse_id: ids that end with .K are recognized as stocks (RIC)
- TRTH_BackFill: error if no .gz file can be found that contains job.name
Modified: pkg/FinancialInstrument/R/parse_id.R
===================================================================
--- pkg/FinancialInstrument/R/parse_id.R 2012-01-02 22:34:54 UTC (rev 901)
+++ pkg/FinancialInstrument/R/parse_id.R 2012-01-03 19:46:22 UTC (rev 902)
@@ -49,7 +49,7 @@
suffix <- gsub("_","",suffix) #take out the underscore if there is one
} else if (identical(integer(0), grep("[0-9]",x))) {
#if there are no numbers in the id, then it has no year, so it is not a recognized future or option
- if (substr(x, nchar(x)-1, nchar(x)) == ".O") {
+ if (substr(x, nchar(x)-1, nchar(x)) %in% c(".O", ".K")) {
#only one dot, and the id ends with ".O" -- it looks like an X.RIC for a NASDAQ stock
suffix <- ""
root <- substr(x, 1, nchar(x)-2)
Modified: pkg/FinancialInstrument/inst/parser/TRTH_BackFill.R
===================================================================
--- pkg/FinancialInstrument/inst/parser/TRTH_BackFill.R 2012-01-02 22:34:54 UTC (rev 901)
+++ pkg/FinancialInstrument/inst/parser/TRTH_BackFill.R 2012-01-03 19:46:22 UTC (rev 902)
@@ -193,8 +193,9 @@
files.gz <- Reuters.output[!(Reuters.output %in% Archive.output)]
#files.gz <- paste(username, "-", job.name, ".csv.gz", sep="")
-
+
if (length(files.gz) == 0) files.gz <- Reuters.output
+ if (length(files.gz) == 0) stop('Cannot find .gz file containing "job.name" Maybe it has already been purged?')
.TRTH$files.gz = files.gz
assign(".TRTH", .TRTH, pos=.GlobalEnv)
More information about the Blotter-commits
mailing list