I'm happy to try it out but a little confused as to all the locations
I need to edit. Help me clear this up and I'll try it out immediately.
The failure is coming when I'm trying to get the data using the
+ if (!UseMySQL){
+ for (i in 1:length(TestSym)){
+ print(paste("From ",SymbolSrc," -- ",TestSym[i]))
+ getSymbolsCont(TestSym[i], from = DataStart, to = DataEnd,
adjust = MyAdjust, src=SymbolSrc)
+ }
+ } else {
+ for (i in 1:length(TestSym)){
+ print(paste("From MySQL -- ",TestSym[i]))
+ # getSymbols(TestSym[i], src="MySQL")
+ getSymbols(TestSym[i], src="MySQL", user="mark",
password="MyTempPassword", dbname=dbName)
+ assign(TestSym[i],
get(TestSym[i])[paste0(DataStart,"/",DataEnd)])
+ }
+ dbDisconnect(dbc)
+ }
+ }
[1] "From MySQL -- SPY"
Show Traceback
Rerun with Debug
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ?dbConnect? for
signature ?"character"?
Am I correct that the suggestion is to edit two lines?
First, I use
library(RMySQL)
Is the first edit to change this to
requireNamespace("RMySQL", quietly = TRUE)
or do I add this to my code somewhere and keep the library command?
No, you shouldn't need to change anything in your code.
Later in my code I have:
if (UseMySQL){
if (MyAdjust) { dbName = paste0(dbName, "Adjust")}
dbc = dbConnect(MySQL(), dbname=dbName)
# setDefaults(getSymbols.MySQL, user="mark",
password="MyTempPassword", dbname=dbName)
}
This would be where the second edit goes?
dbConnect("MySQL", ...) to dbConnect(RMySQL::MySQL, ...)
No. Again, you shouldn't need to change your code. The change
required is on L614 of getSymbols.R.
--
Joshua Ulrich | about.me/joshuaulrich
FOSS Trading | www.fosstrading.com
In that case I'll leave it to someone else to test. I don't want to
mess with non-production libraries. My skill set in this code isn't
good.
Good luck,
Mark