-
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
New CompadreData structure, new accessor methods, all functions use accessor methods #32
Conversation
…cessor functions for data, small updates to functions. Closes 4 issues. 1. Changed the structure of CompadreData object, so that now there are two slots: 1. 'data', which contains a data.frame with the original 'metadata' plus a list column 'mat' containing the CompadreM objects, and 2. a 'version' slot which contains version information. This addresses issues jonesor#27 and jonesor#29 at github.com/jonesor/Rcompadre and ties the order metadata and matrices more closely together. 2. Accessor functions for almost anything contained in the databases have been added, which addresses issue jonesor#23. It is still possible to access matrices and metadata separately to one another, even though they are now contained in one data.frame. 3. All functions and methods have been updated to use these accessor functions rather than accessing information directly from the slots (completes issue jonesor#15). If we wish to change the structure of the classes in the future, this minimises the work needed to go into making sure the methods and functions work with the new structure, as we only have to change the accessor functions rather than everything. Accessor functions should be used in the future rather than accessing information directly from the slots. 4. Added a pseudo superclass CompadreMorData which allows methods to be utilised by both classes (these pertain to matrices and matrixClass information). 5. Changed collapseMatrix, getMeanMatF, IdentifyReprodStages, rearrangeMatrix, splitMatrix so that they work with CompadreM objects as well as specific matrices that have been passed to them.
Let me know if there are any confusions about what's been changed and how it all works... |
Nice! Just tryin to give it a whirl, but I can't get
Also, the |
Thanks! Owen wants to use the new package in BES workshop in Dec so we made some hasty decisions about moving forward. Current structure need not remain as it is; I've changed (nearly) everything in the .R files so that the code uses accessor methods rather than going to the slots directly, which I read somewhere is bad practise. If we want to change the structure then we need only change these methods (plus a tiny bit more that I couldn't convert unless we add more methods). Thanks for picking up on bugs, hopefully Owen can work these in with the pull request. I didn't do any testing myself as I've spent quite a long time on this as is... RE the last point about I think it'll be simple enough to provide a function that converts the data to a |
Thanks @iainmstott - I will Merge this pull request as a "merge commit". Then I will try to fix the issues that @patrickbarks Patrick has raised. |
Changes to class structure and associated changes in S4 addessing, accessor functions for data, small updates to functions. Closes 4 issues.