florale / multilevelcoda

multilevelcoda R package for Bayesian multilevel compositional data analysis
https://florale.github.io/multilevelcoda/
GNU General Public License v3.0
13 stars 2 forks source link

Issue with Substitution #6

Open margauxw opened 7 months ago

margauxw commented 7 months ago

Hello,

I keep getting the following error

Error in [.data.frame(d0, , colnames(d0) %in% colnames(object$CompILR$data), : unused argument (with = FALSE)

Code: subm2 <- substitution(object = model1, delta = 1:2 ref = "clustermean", level ="within", weight = 'proportional')

I get it to work with 'grandmean', but only if I add weight = 'proportional' (which I was planning to do anyway) - but this does not fix it for clustermean. Changing the delta, level, or weight doesn't fix it.

Removing weights gives (for both grandmean/clustermean setting) Error in [.data.frame(d0, , head(.SD, 1), by = eval(object$CompILR$idvar)) : unused argument (by = eval(object$CompILR$idvar))

Model 1's output looks fine and output of the substitution model for the grandmean as well.

florale commented 7 months ago

I can't quite diagnose given your code. Could you provide a reproducible example?