Skip to content

Commit 59de2bd

Browse files
committed
Replaced start/end variables with from/to to match rest of package.
Replaced database.table with `table` in select statement.
1 parent a8a3e83 commit 59de2bd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

R/getSymbols.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ function(Symbols,env,return.class='xts',
599599
db.fields=c('date','o','h','l','c','v','a'),
600600
field.names = NULL,
601601
user=NULL,password=NULL,dbname=NULL,host='localhost',port=3306,
602-
start=NULL, end=NULL, ...) {
602+
from=NULL, to=NULL, ...) {
603603
importDefaults("getSymbols.MySQL")
604604
this.env <- environment()
605605
for(var in names(list(...))) {
@@ -632,10 +632,10 @@ function(Symbols,env,return.class='xts',
632632
cat(paste('Loading ',Symbols[[i]],paste(rep('.',10-nchar(Symbols[[i]])),collapse=''),sep=''))
633633
}
634634

635-
if (!is.null(start) & !is.null(end)) {
636-
query <- paste("SELECT ", paste(db.fields, collapse = ","), " FROM ", paste(dbname, ".", Symbols[[i]], sep = ""), " WHERE date >= '", start, "' AND date <= '", end, "' ORDER BY date")
635+
if (!is.null(from) & !is.null(to)) {
636+
query <- paste("SELECT ", paste(db.fields, collapse = ","), " FROM `", Symbols[[i]], "` WHERE date >= '", from, "' AND date <= '", to, "' ORDER BY date")
637637
} else {
638-
query <- paste("SELECT ", paste(db.fields, collapse = ","), " FROM ", paste(dbname, ".", Symbols[[i]], sep = ""), " WHERE date ORDER BY date")
638+
query <- paste("SELECT ", paste(db.fields, collapse = ","), " FROM `", Symbols[[i]], "` WHERE date ORDER BY date")
639639
}
640640

641641
rs <- DBI::dbSendQuery(con, query)

0 commit comments

Comments
 (0)