benyamindsmith / starBliss

Create beautiful, print quality maps of the night sky in R
43 stars 2 forks source link

Avoid changing users global options #3

Closed laresbernardo closed 1 year ago

laresbernardo commented 1 year ago

Function "options" is undesirable in packages. Use withr::with_options() for a temporary change instead or suppress. Ref: https://github.com/benyamindsmith/starBliss/blob/79a812f455cd6e4faf3cd8a74196c2676d876439/R/past_starmap.R#L54

benyamindsmith commented 1 year ago

@laresbernardo Noted. Is there a way to do this without having the code contained in its entirety of with_options()?

laresbernardo commented 1 year ago

Not really. I think you could suggest in the demo or examples for users to change any option manually. You could also wrap the warning you want to suppress with suppressWarnings() I guess.

benyamindsmith commented 1 year ago

@laresbernardo see the fix I have here let me know how it goes on your end.