Skip to content
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

Setting random number generator #73

Closed
rmarko opened this issue Apr 28, 2017 · 2 comments
Closed

Setting random number generator #73

rmarko opened this issue Apr 28, 2017 · 2 comments
Labels
bug

Comments

@rmarko
Copy link

@rmarko rmarko commented Apr 28, 2017

Dear Kamil,

I really like the package, it does a great job.
I noticed that as a side effect of every call to geom_text_repel the seed of the random number generator is reset to a fixed value. This is a potentially dangerous side effect which, in my case, is causing deterministic behavior of the program, where it should be stochastic. Once one knows about it it is not difficult to fix this behavior, but it can lead to difficult to find bugs in the code. Please, can you fix this.

Best regards,
Marko

@slowkow
Copy link
Owner

@slowkow slowkow commented Apr 28, 2017

Hi Marko,

Thanks for reporting this issue, and thanks for the kind words. I hadn't considered the side effects of setting the random seed inside geom_text_repel. I need some time to consider how to best solve this issue.

It would be helpful to write a minimal code example that demonstrates the problem. I'd greatly appreciate if you can share such a code example.

Could I please ask you to post your session info with the following command? I need to know what version of ggrepel is affected by this problem.

devtools::session_info()

A note for myself: in commit 0b0a7ab I set the seed to a random number, and this was done to fix issue #33.

@slowkow slowkow added the bug label Apr 28, 2017
@rmarko
Copy link
Author

@rmarko rmarko commented Apr 29, 2017

There seem to be an issue with some of the other packages I am using (modifying the .Random.seed directly and not via set.seed function). By doing a clean install your package works as it should. Sorry for troubling you.

@rmarko rmarko closed this Apr 29, 2017
slowkow added a commit that referenced this issue Jul 17, 2017
Addresses issues #33 and #73

Now users can choose to make plots reproducible if they wish.
pgramme pushed a commit to pgramme/ggrepel that referenced this issue Jul 17, 2017
checking that issue slowkow#73 is resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.