Hi folks,
I have some problems plotting a distance model with two covariables.
My model is:
hr.size.amb <- ds(df_dist, key="hr",
convert_units=conversion.factor,
transect="line", formula=~ size + amb)
`size` and `amb` are categorical variables with two and three levels, respectively.
After plotting the model like this:
plot(size.amb, breaks=cutpoints, showpoints=TRUE)
I would like to add level to level of the covariable size using:
add.df.covar.line(hr.size.amb, data=data.frame(size="small"), lwd=3, lty=1, col="#a50026")
I get the following error message:
Error in eval_with_covars(xx, data[i, ], df, pdf) : columns in `newdata` do not match those in fitted model
Could someone please help me with a simple example to make a plot with two covariables in the model?
Thanks so much, Juan
amb
), you will likewise need values for both covariates in the data frame you are passing to
add_df_covar_line
. I don't know what value of amb
you would like to examine, but here is a possibilitysize
is small and
amb
is the mean of the values of amb
in your data set.amb
in your new data set to a value of interest to you.Juan Pablo Zurano
Instituto de Biología Subtropical (IBS, CONICET-UNaM), Nodo Iguazú
Av. Tres Fronteras 183 (3370) Puerto Iguazú, Misiones, Argentina.
Telefono: +54 3757 42-3289 Celular: +54 3764 15 879558,
www.ibs-conicet.gob.ar