powered by
Converts input to data.table if needed, always returning a copy to prevent accidental data mutation. Core safety function used throughout the library.
ensure_dt_copy(data)
Copy of data as data.table
Data.frame or data.table
data("sample_prices_weekly") dt <- ensure_dt_copy(sample_prices_weekly) # Safe to modify dt
Run the code above in your browser using DataLab