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

Style suggestion #33

Open
n8thangreen opened this issue Oct 2, 2020 · 1 comment
Open

Style suggestion #33

n8thangreen opened this issue Oct 2, 2020 · 1 comment

Comments

@n8thangreen
Copy link
Contributor

sim <- do.call(paste0("make_sim_",fit$method),

Hi, I'm finding these compound do.call() lines a bit hard to reason about. Can I suggest splitting them up e.g.

make_sim_fns <- paste0("make_sim_", fit$method)
make_sim_args <- list(m=m,t=t,X=X,nsim=nsim,newdata=newdata,dist=dist,data=data,
formula=fit$misc$formula,
summary_stat=summary_stat)
sim <- do.call(make_sim_fns, args = make_sim_args)

Thanks!

@giabaio
Copy link
Owner

giabaio commented Oct 5, 2020

Thanks @n8thangreen. As I understand, your suggested changes are purely cosmetics, though? So you'd rather have the two separate lines defining the call and args and then the do.call command? If so, that can be easily arranged --- still in the process of getting the devel version on CRAN (should be shortly), then I can change this too.
Did you see this in other places? I think I was using do.call relatively extensively in this release, which works fine for me, TBH, but perhaps can be made clearer for a contributor to look at...

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