Skip to content

Consider moving PM_options to options #26

@mhovd

Description

@mhovd

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.

Looking for input from @mnneely and @Siel .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions