I have a dataset of five stocks and their returns that I'm trying to modify the dataset and eventually create a covariance matrix. I've been trying the function below to convert the dataset into a time series object using the "xts" function:
log_ret_xts <- log_ret_tidy %>%
spread(symbol, value = ret) %>%
tk_xts()
I get the error message Error in tk_xts(.) : could not find function "tk_xts"
I should have all needed packages installed, any help?