After getting data as a dplyr tibble, the first thing you might want to do is convert it into a time-series (xts) object. Here’s the recommended way:
indices <- Indices() #for IndiaGsecTimeSeries
ycInd <- indices$IndiaGsecTimeSeries() %>%
filter(NAME == "5_10" & TIME_STAMP >= startDate) %>%
select(TIME_STAMP, YIELD = YTM) %>%
mutate(TIME_STAMP = as.Date(TIME_STAMP))
ycIndXts <- xts(ycInd$YIELD, ycInd$TIME_STAMP)
Just in case the above code snippet doesn’t render properly:
The mutate has to come after the collect. Otherwise, mutate ends up running as an SQL query in the database and TIME_STAMP remains a string.
Questions? slack me!
To get started with R notebooks on pluto, some standard libraries need to be imported and config files sourced. Start with these, in this specific order:
options(stringsAsFactors = FALSE)
The first set allows you to access pluto datasets, the second is some common-sense settings and lastly, the config file.
To get productive, add these:
goofy is a set of common plotting and date-resetting functions. The rest are some commonly used packages for financial data analysis in R.
If you need any specific package for your work, either raise an issue on github or slack me!