dwarton / mvabund

mvabund updates
10 stars 14 forks source link

error with manyglm using $ in the formula and composition = T #81

Closed CMPhelps closed 2 years ago

CMPhelps commented 4 years ago

Hello,

I'm getting the error ‘variable lengths differ’ when using the a $ in the manyglm formula, when composition =T

Herbivores <- read.csv(file = "Herbivore_specialisation.csv", header = TRUE) Herb_spp <- mvabund(Herbivores[,5:11]) mod3 <- manyglm(Herb_spp ~ Herbivores$Habitat*Herbivores$DayNight, composition = T, family="negative_binomial")

Error in model.frame.default(formula = formLong, data = dat, subset = subset, : variable lengths differ (found for 'Herbivores$Habitat')

I am able to get the model to work using:

  1. manyglm(Herb_spp~Habitat*DayNight, data = Herbivores))
  2. hab = Herbivores$Habitat DN = Herbivores$DayNight manyglm(Herb_spp~hab*DN)

Can this be corrected? Thank you

dwarton commented 2 years ago

this seems to have been addressed by v4.2.2