I am attempting to write a formula that will return a stocks single day return, but I believe im having trouble with the data type of the periodReturn
subset
field
periodReturn(ticker,period='daily',subset='20161010::20161010')
works but
dayReturn <- function(ticker,date) {
ticker <- c(MSFT)
date <- c(20161010)
dayreturn <- periodReturn(ticker,period='daily',paste("subset='",date,"::",date,"'"))
dayreturn
}
gives error
dayReturn(msft,20161010)
daily.returns
Warning messages:
1: In as_numeric(YYYY) : NAs introduced by coercion
2: In as_numeric(MM) : NAs introduced by coercion
3: In as_numeric(DD) : NAs introduced by coercion
>
Thanks in advance for any advice!