New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cautionary tales about changing global state #447

Open
jennybc opened this Issue Jan 21, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@jennybc
Collaborator

jennybc commented Jan 21, 2018

For possible inclusion as a sidebar in a future edition, somewhere in this vicinity:

https://github.com/hadley/r-pkgs/blame/master/r.rmd#L305

Two recent-ish examples around random number generation that show how careful you need to be when changing global state in your package.

ggplot2's use of a random number to display a message upon startup (but only in interactive sessions)

htmlwidgets touching the seed

Paraphrasing discussion elsewhere: "don't touch things that don't belong to you and if you have to, you need to be super careful to wipe all your sticky fingerprints off everything"

@jennybc

This comment has been minimized.

Collaborator

jennybc commented Jan 22, 2018

And another little tale, also re: random numbers from @topepo, this time implicating car:

topepo/caret#452 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment