The combine_data function in transformations.R is extremely long and should be refactored. The function is thoroughly tested—please ensure all tests continue to pass after refactoring. The goals are to:
- Break the function into smaller, more manageable components.
- Improve readability and maintainability.
- Reduce overall complexity.
- Maintain all current tests and functionality.