Skip to content

Commit

Permalink
Update to species covariates if formula given
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipMostert committed Aug 28, 2024
1 parent 6cb0de5 commit a30a030
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/modSpecies_predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,16 @@ predict.modSpecies <- function(object, data = NULL, formula = NULL, mesh = NULL,

if (!is.null(covariates)) {

if (paste0(spec, '_Fixed__Effects__Comps') %in% names(object$summary.random)) species_covs <- paste(spec, '_Fixed__Effects__Comps')
species_covs <- NULL

if (paste0(spec, '_Fixed__Effects__Comps') %in% names(object$summary.random)) species_covs <- paste0(spec, '_Fixed__Effects__Comps')

if(is.null(species_covs)) {

if (object[['species']][['speciesEffects']][['Environmental']]) species_covs <- paste0(spec, '_', covariates)
else species_covs <- covariates

}
}
else species_covs <- NULL

Expand Down

0 comments on commit a30a030

Please sign in to comment.