Creates an optimized blueprint object with sparse storage using R environments for hash-table like performance. Only populated cells consume memory, providing significant memory savings for typical sparse table structures.
Value
An object of class "table1_blueprint" with components:
cells: Environment with hash-table storage for cellsnrows: Number of rowsncols: Number of columnsrow_names: Character vector of row identifierscol_names: Character vector of column headersmetadata: List containing structural information
Details
The optimized blueprint uses environment-based sparse storage instead of pre-allocating all cells. Benefits include:
Memory usage scales with actual content, not table dimensions
O(1) hash-table lookup for cell access
Automatic garbage collection of unused cells
Support for very large sparse tables
Examples
# Small table - minimal memory usage
bp_small <- Table1Blueprint(5, 3)
bp_small[1, 1] <- Cell(type = "content", content = "Variable")
# Large sparse table - still efficient
bp_large <- Table1Blueprint(1000, 100) # Only uses memory for metadata
