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

Bug? "verbose" argument changes output of foreach() function #45

Open
jmbh opened this issue Feb 29, 2024 · 1 comment
Open

Bug? "verbose" argument changes output of foreach() function #45

jmbh opened this issue Feb 29, 2024 · 1 comment

Comments

@jmbh
Copy link

jmbh commented Feb 29, 2024

Reproducible example:

v_out2 <- foreach(i = 1:nIter, verbose=TRUE, .combine = 'c') %do% {
set.seed(i)
data <- rnorm(1)
return( mean(data))
}
v_out2
[1] -0.6264538

I get the same for "verbose=FALSE". However, if I don't specify "verbose" at all I get:

v_out2 <- foreach(i = 1:nIter, .combine = 'c') %do% {
set.seed(i)
data <- rnorm(1)
return( mean(data))
}

v_out2
[1] -0.62645381 -0.89691455 -0.96193342 0.21675486 -0.84085548
[6] 0.26960598 2.28724716 -0.08458607 -0.76679604 0.01874617

as I should.

I am using the latest version from CRAN (foreach_1.5.2).

@HenrikBengtsson
Copy link

It's .verbose not verbose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants