loadRforce() restores a previously saved Rforce object from a
specified directory. It reconstructs both the R-side object (stored as
Rforce.rds) and the associated C++ forest structure via the
R_LoadRforce routine, ensuring full functionality.
Arguments
- path
A character string specifying the directory containing the saved
Rforceobject. The directory must includeRforce.rdsand a single forest data subdirectory created bysaveRforce().
Value
A fully functional Rforce object with a reconstructed external
forest pointer, ready for prediction, visualization, or further analysis.
Details
The function performs the following tasks:
Reads the
Rforce.rdsfile to reconstruct the R-side object.Validates that the restored object inherits class
"Rforce".Locates the associated forest data directory.
Calls the native routine
R_LoadRforceto rebuild the C-allocated forest structure, restoring the external pointer at_external_forest_C_Ptr.
If the directory structure is invalid or the C pointer fails to load, an error is raised.