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

Avoid using set.seed() in unit tests and examples #37

Closed
PietrH opened this issue Apr 4, 2024 · 1 comment
Closed

Avoid using set.seed() in unit tests and examples #37

PietrH opened this issue Apr 4, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@PietrH
Copy link
Collaborator

PietrH commented Apr 4, 2024

As I understand the documentation, once you call set.seed() the seed is set for the session, even if future function calls don't specify a seed. So to avoid overwriting the seed of users, and to have the package behaviour as predictable as possible, we should avoid doing this.

See this section of the R packaging guide; https://r-pkgs.org/code.html#sec-code-r-landscape

Maybe using withr? I'm not sure yet, I'm splitting this off from #36 as it's no longer in use within the functions of this package, and thus now less urgent.

@PietrH PietrH added the enhancement New feature or request label Apr 4, 2024
@wlangera wlangera mentioned this issue Sep 9, 2024
@wlangera
Copy link
Collaborator

wlangera commented Sep 9, 2024

fixed in #98

@wlangera wlangera closed this as completed Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants