| ensure_dt_copy | R Documentation |
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)
data |
Data.frame or data.table |
Copy of data as data.table
data("sample_prices_weekly")
dt <- ensure_dt_copy(sample_prices_weekly) # Safe to modify dt
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.