Skip to content

Fix: do not change user options or par for network_p2p() #60

@martinctc

Description

@martinctc

Currently there is a par() argument used within network_p2p(), network_leiden(), and network_louvain() where user's plotting options are changed within the function. This is not allowed as per CRAN submission requirements. Full detail are:

Please make sure that you do not change the user's options, par or
working directory. If you really have to do so within functions, please
ensure with an immediate call of on.exit() that the settings are reset
when the function is exited. e.g.:
...
oldpar <- par(no.readonly = TRUE) # code line i
on.exit(par(oldpar)) # code line i + 1
...
par(mfrow=c(2,2)) # somewhere after
...

...
old <- options() # code line i
on.exit(options(old)) # code line i+1
...
options(digits = 3)
...
e.g.:
If you're not familiar with the function, please check ?on.exit. This
function makes it possible to restore options before exiting a function
even if the function breaks. Therefore it needs to be called immediately
after the option change within a function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorCode that neither fixes a bug nor changes feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions