Here are the first few lines of an R function that works:
teetor <- function(x,y) {
require("quantmod")
require("tseries")
alpha <- getSymbols(x, auto.assign=FALSE)
bravo <- getSymbols(y, auto.assign=FALSE)
t <- as.data.frame(merge(alpha, bravo))
# ... <boring unit root econometric code>
}
When I pass two stock symbols as function parameters, I need to enclose them with quotes:
teetor("GLD", "GDX")
I want to be able to simply type:
teetor(GLD, GDX)