Loads a file associated with a user from the configured storage backend. The backend is determined by the `ACCOUNT_BACKEND` environment variable (default is `"file"` for local storage), and supports loading various file types like `.Rds`, `.json`, and `.csv` via the appropriate plugin.
Details
This function provides a unified interface to load user-specific data, regardless of where or how it is stored (e.g., local file system, cloud, or database). The actual loading logic is delegated to a plugin based on the backend, which is configured using environment variables.
The function constructs the appropriate arguments for the selected backend using `build_plugin_args()` and dispatches the call using `do.call()`. The file type determines how the file is parsed (e.g., `.Rds` via `readRDS()`, `.json` via `jsonlite::fromJSON()`).
See also
[save_user_file()], [build_plugin_args()], and plugin implementations like `load_from_file()`.
Examples
if (FALSE) { # \dontrun{
Sys.setenv(ACCOUNT_BACKEND = "file")
load_user_file("user123", "account_tree.Rds")
load_user_file("user123", "transactions.csv")
} # }