survHE icon indicating copy to clipboard operation
survHE copied to clipboard

Style suggestion

Open n8thangreen opened this issue 5 years ago • 1 comments

https://github.com/giabaio/survHE/blob/f96cd9db50c6e129e1f425114c6bc33f7bdc2a6b/R/make.surv.R#L98

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!

n8thangreen avatar Oct 02 '20 18:10 n8thangreen

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...

giabaio avatar Oct 05 '20 08:10 giabaio