-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding derived vectors/matrices to a CompadreData object #26
Comments
I can jump in quite quickly on this one. The short answer is: it's not possible and probably not desirable with S4. The long answer is... Some justification: Options to do what you need:
I get where you're coming from... the new structure will probably change the way I work with the data too. But for me, the benefits of locking in the structure of the databases for general use outweighs this. If/when we get to functions that query and pull straight from the servers, having this locked-in structure will also be really helpful, I think. |
The |
I somehow didn't realize that an S3 data.frame could have list-columns. I thought that was extra tibble magic, but I see now that it works just fine with data.frame too. So that basically solves all my problems. Regardless, I like the idea of merging |
Adding derived columns is now straightforward thanks to @iainmstott's updates in #32 and #43, so closing this issue. |
Related to #25, I think it would be useful if there was a way for a user to add new slots containing either vectors, matrices, or lists to a CompadreData object.
In many demographic analyses users will want to derive vectors or matrices from an MPM (e.g. population vector, stable distribution, sensitivity matrix, collapsed or rearranged matrix), and it would be ideal if these remained part of the CompadreData object to maintain the mapping with the metadata and original MPM. This becomes particularly important if the user wishes to subsequently subset the db based on some derived value(s).
Many of the functions in Rcompadre/Rage return vectors or matrices derived from an MPM (e.g. reprodStages, identifyReprodStages, rearrangeMatrix, splitMatrix, collapseMatrix), and I gather these currently need to be stored separately from the db.
I don't know much about S4 and so don't have a sense of whether this is feasible, but perhaps @tdjames1 and @iainmstott can weigh in.
The text was updated successfully, but these errors were encountered: