Hi
it could be a filename issue for the temporary files.
can you test if this works and send me the output?
library(INLA)
inla(y~1, data=data.frame(y=0), verbose=TRUE, debug=TRUE)
thx
best
Havard
On Sat, 2025-11-29 at 18:00 -0500, Elvira D'Bastiani wrote:
> Dear R-INLA community,
>
> I am trying to use the INLA package for analysis, but I am encountering some
> difficulties. I am following the instructions on
>
https://www.r-inla.org/download-install, but I keep running into the same
> error. The error message I receive is:
>
> > > > > Error in inla.core.safe(formula = formula, family = family, contrasts
> > > > > = contrasts, :
> > > > > The inla result collection failed.
> > > > > The inla result collection failed
>
>
> I am trying to run the model using an example from
>
https://ourcodingclub.github.io/tutorials/inla/.
>
> Could someone help me understand what is happening and how to resolve this
> issue?
>
> Thank you very much for your support.
>
> Best regards
> Elvira
>
>
> - here is the script, the messages I received when I tried to run:
>
>
>
> R version 4.5.2 (2025-10-31 ucrt) -- "[Not] Part in a Rumble"
> Copyright (C) 2025 The R Foundation for Statistical Computing
> Platform: x86_64-w64-mingw32/x64
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
> Natural language support but running in an English locale
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
> > library(BiocManager)
> Bioconductor version 3.22 (BiocManager 1.30.27), R 4.5.2 (2025-10-31 ucrt)>
> library(graph)
> Loading required package: BiocGenerics
> Loading required package: generics
>
> Attaching package: ‘generics’
>
> The following objects are masked from ‘package:base’:
>
> as.difftime, as.factor, as.ordered, intersect, is.element, setdiff,
> setequal, union
>
>
> Attaching package: ‘BiocGenerics’
>
> The following objects are masked from ‘package:stats’:
>
> IQR, mad, sd, var, xtabs
>
> The following objects are masked from ‘package:base’:
>
> anyDuplicated, aperm, append, as.data.frame, basename, cbind, colnames,
> dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
> grepl, is.unsorted, lapply, Map, mapply, match, mget, order, paste,
> pmax,
pmax.int, pmin,
pmin.int, Position, rank, rbind, Reduce,
> rownames, sapply, saveRDS, table, tapply, unique, unsplit, which.max,
> which.min> library(Rgraphviz)
> Loading required package: grid> library("devtools")
> Loading required package: usethis
>
> Attaching package: ‘devtools’
>
> The following object is masked from ‘package:BiocManager’:
>
> install> #loading libraries
> > library(Matrix)
> > library(INLA)
> This is INLA_25.10.19 built 2025-10-19 19:10:20 UTC.
> - See
www.r-inla.org/contact-us for how to get help.
> - List available models/likelihoods/etc with inla.list.models()
> - Use inla.doc(<NAME>) to access documentation> library(ggplot2)
> > library(ggregplot)
> > library(tidyverse)
> > library(RColorBrewer)
> > library(dplyr)
> > library(devtools)
> > Hosts <- read.csv("G:/My Drive/1. Pós-doc Cornell University 2025-present/1.
> > Project 1 - Yellow fever/Yellow_Fever_BR_2025/INLA
> > analysis/HostCaptures.csv", header = T)
> > substr(names(Hosts), 1, 1) <- toupper(substr(names(Hosts), 1, 1)) # Giving
> > the host names capital letters
> > phen <- c("Grid", "ID", "Easting", "Northing") # Base columns with spatial
> > information we'll need
> > resp <- "Parasite.count" # Response variable
> > covar <- c("Month", # Julian month of sampling
> + "Sex", # Sex
> + "Smi", # Body condition
> + "Supp.corrected", # Nutrition supplementation
> + "Treated") # Treatment
> > TestHosts <- na.omit(Hosts[, c(phen, resp, covar)]) # Getting rid of NA's,
> > picking adults
> > # Turning variables into factors
> > TestHosts$Month <- as.factor(TestHosts$Month)
> > TestHosts$Grid <- as.factor(TestHosts$Grid)
> > TestHosts$Parasite.count <- round(TestHosts$Parasite.count) # Parasite
> > counts should be integers
> > table(table(TestHosts$ID)) # Enough repeat samples for a mixed model?
>
> 1 2 3 4 5 6 7 8 13
> 18 10 6 2 6 5 3 2 1
> > table(with(TestHosts, tapply(Grid, ID, function(x) length(unique(x)))))
>
> 1 2 3
> 42 10 1
> > # Specify the formula
> > f0.1 <- as.formula(paste0(resp, " ~ ", # Response first
> + paste(covar, collapse = " + "))) # Collapse the
> vector of covariates
> > # Convert character columns to factors
> > TestHosts$Sex <- as.factor(TestHosts$Sex)
> > TestHosts$Supp.corrected <- as.factor(TestHosts$Supp.corrected)
> > TestHosts$Treated <- as.factor(TestHosts$Treated)
> > # Run the model
> > IM0.1 <- INLA::inla(Parasite.count ~ Month + Sex + Supp.corrected +
> > Treated,
> + family = "nbinomial", # Specify the family. Can be a wide
> range (see
r-inla.org).
> + data = TestHosts) # Specify the data
> Error in inla.core.safe(formula = formula, family = family, contrasts =
> contrasts, :
> The inla result collection failed.
> The inla result collection failed.
>
>
>
> Elvira D'Bastiani (she/her)
> Postdoctoral Research Associate - Bento Lab
> Department of Public and Ecosystem Health
> Cornell University | Ithaca, New York, USA
> 🌐
elviradbastiani.com
--
Håvard Rue
he...@r-inla.org