Skip to content

Set options in .onLoad() instead? #4

@HenrikBengtsson

Description

@HenrikBengtsson

Hi, a drive-by comment since I happened to see:

.onAttach <- function(libname, pkgname)
{
options(optimParallel.forward=getOption("optimParallel.forward", FALSE))
options(optimParallel.loginfo=getOption("optimParallel.loginfo", FALSE))
}

If you use .onLoad() instead of .onAttach(), then those R options will be set also when someone uses your package without library(), e.g. when importing optimParallel() in another package, or when calling it as:

res <- optimParallel::optimParallel(...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions