-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Currently, we have a custom structure to store options, which are stored in a json file.
This is problematic for a few reasons, most importantly that if we call a function without loading the package using library(Pmetrics), the functions setPMoptions() and getPMoptions() are not available.
I suggest that we consider storing our options using the base options() structure. This fully avoids relying on a json file, which can potentially be corrupted. Furthermore, we no longer have to consider the OS to figure out where to store the file.
Default values can be written when the package is first loaded, e.g. using a on.Load() hook in e.g. zzz.R.
Values specific to Pmetrics could be identified by the PM_ prefix.
Instead of setPMoptions("dec", ","), we would use options("PM_dec" = ","). Then to get the value, we call getOption("PM_sep").
This should be fully compatible with the shiny application as well.