Error in apply
madichpy opened this issue · 0 comments
Hello
I am trying to use SCGLR package for a multivariate analysis that includes 3 dependent variables, 1 categorical dependent variable (burnt and unburnt), and two additional covariates (temperature and humidity), but I get this error when trying to complete the script:
Error in apply(x, 2, mean) : dim(X) must have a positive length
Can anyone tell me what is causing this?
I present my script (and its results) below:
build multivariate formula
ny <- c("taxa_pulsos","duracao","energia")
nx1 <- c("fogo")
nadd <- c("temperatura","umidade")
form <- multivariateFormula(ny,nx1,A=nadd)
form
Multivariate formula
taxa_pulsos + duracao + energia ~ fogo | temperatura + umidade
Response:
Y = taxa_pulsos + duracao + energia
Covariates:
T1 = fogo
A = temperatura + umidade
summary(form)
Length1 Length2 Class1 Class2
1 2 MultivariateFormula Formula
Class3 Mode
formula calldefine family
fam <- rep("poisson",length(ny))
genus.scglr <- scglr(formula=form,,data = dados,family=fam)
Error in apply(x, 2, mean) : dim(X) must have a positive length