How tbates/umx works
Project Type and Purpose
• This is an R-package meant to offer a high-level API (“umx” functions) wrapping around SEM functionality (especially via OpenMx, and even incorporating lavaan script interpretation) and providing twin modeling tools.
• Its purpose is to let users build, modify, and report SEM and twin models quickly – with additional support for data handling, parameter estimation, and graphical outputs.
File Structure and Key Directories
• Core R Code (located in the “R” directory):
– Contains the implementation of various umx functions (e.g., umxRAM, umxACE, umxPlot, umxSummary, etc.).
– There are both high-level functions for model building and reporting, along with many low-level helper and utility functions.
• Documentation (located in “man”, “README.md”, and “NEWS.md”):
– The “man” directory holds the Rd files for function documentation, indicating that every function is documented for user reference.
• Data and Example Files:
– “data” contains .rda files for built-in datasets used as examples or for testing.
– “inst” encloses developer materials (including examples, tests that aren’t part of the automated test suite, and additional resources like citations), as well as other auxiliary resources.
• Testing and Continuous Integration:
– The “tests” directory includes test suites (using testthat) to verify that functions behave as expected.
– Configuration files for GitHub Actions (.github/workflows) and Travis (.travis.yml) indicate automated build and testing processes.
• Package Metadata and Build Files (e.g., DESCRIPTION, NAMESPACE, .Rbuildignore):
– They reflect standard R-package conventions for dependency management, exported functions, and versioning.
Main Components
a. Public API / User-Facing Interface:
– Indicate that users typically interact with these functions via scripts in R.
b. Core Functionality and Utility Functions:
• High-level functions (model building, modifying models, twin modelling functions like umxACE, umxDoC).
• Low-level helper and utility functions (naming, start values generation, data wrangling utilities).
c. Data and Example Datasets:
– Include a component representing “Data Assets” (sourced from the “data” directory) used by the functions for examples and validations.
d. Developer and Documentation Support:
– A component for “Documentation & Help” covering “man” files, README, and online tutorials.
e. Testing and Continuous Integration:
– Add a section for “Testing Suite” to capture automated testing (tests/testthat).
f. External Dependencies:
– Represent integration with external libraries (e.g., OpenMx, lavaan) which are suggested by the README and by the naming (“umx” stands as “user OpenMx functions”).
Representing Relationships and Data Flow
• The “Public API” calls into the “Core Functionality” which, in turn, may call the “Utility Functions”.
• That “Developer Resources” and documentation feed into both user understanding and continuous improvement, with testing ensuring robustness.
• External dependencies should point into the “Core Functionality” to demonstrate where underlying SEM routines are executed.