Suppose I have a list of R objects, which themselves are lists. Each list has a specific structure: data, a model that corresponds to data and some attributes for identifying data. One example is the time series of certain economic indicators in specific countries. Therefore, my list object has the following elements:
data - historical time series for an economic indicator
country - name of the country, for example, USA
name - indicator name, for example, GDP
model - ARIMA orders found in auto.arima in the appropriate format can also be a list.
This is just an example. As I said, suppose I have a number of such objects in a list. I would like to save it in some suitable format. The obvious solution is to just use save , but it does not scale very well for a large number of objects. For example, if I only wanted to check a subset of objects, I would need to load all the objects into memory.
If my data is data.frame , I could save it to the database. If I wanted to work with a specific subset of the data, I would use SELECT and rely on the database to deliver the necessary subset. In this regard, I really liked SQLite. Is it possible to reproduce this for my described list object using some fantastic database like MongoDB? Or do I just need to think about how to convert my list into several related tables?
My motivation for this is to be able to easily create various reports on mounted models. I can write a bunch of functions that create some report for a given object, and then just use lapply in my list of objects. Ideally, I would like to parallelize this process, but this is another problem.
source share