tidyquant
tidyquant copied to clipboard
importing data from other R objects
How do I import a timeseries that I have obtained elsewhere and stored in an R object (e.g. a dataframe) into a tidyquant tibble?
Load it into your R session using whatever the best import method for the datafile you have (i.e. tidyr::read_csv() for csv files, or readRDS() if you've saved it as an R object). Once it's in R workspace as a dataframe just use tibble() on the object to convert from dataframe to tibble.
is it then easy to do things such as convert strings to dates, change the periodicity and merge with another tidyquant tibble?
Yes I would think so. A tibble class object is a tibble whether you've imported it yourself and converted it or whether it's the result of tq_get() or some other tq function