Closed abhsarma closed 4 years ago
if the parent environments are set up correctly using get()
on the last environment will search up the tree automatically for you (whereas $ does not). So you should be able to implement extract_variables with get (or mget with inherits = TRUE)
Right, that's what I am using for the $
function for accessing stuff. But the question is should the output of expand(M)
have a .results
column which is the list of universe environments from the bottom level of the tree? I don't think that's very useful to expose it because it has even less use now for a user?
If we decide not to expose it, then the notion of extracting variables from the multiverse_table might not work, but you'd have to do it from the multiverse object itself. Does this make sense?
I think you could leave the .results column in if you update extract_variables to use get() instead of $, because then it will still be useful?
Yeah, could do that. But it seems to me that .results column would just not be very useful?
How else would people extract variables from the model?
With the previous multiverse table structure, where all the stuff related to a single universe analysis runs in a single environment, we had the following workflow for extracting a variable (say x) #63 :
With the new dictionary structure, we are creating the result of expand on the fly from the bottom level of the tree, but it does not have a column of environments (formerly .results). I don't see the point of providing that environment because it will only contain stuff from the last code block
anyway, this complicates the design of the extract_variables function and I am not sure what to do...