如何在R中捕获INLA模型的详细输出



希望这个例子能说明我要做的事情

我对切换详细TRUEFALSE的相同简单示例进行了比较。

library("INLA")
test <- capture.output(
{
inla(speed ~ dist, data = datasets::cars, verbose = F)
}
)

我尝试捕获详细的输出。它出现在我的控制台中,但没有被捕获。CCD_ 3和CCD_。

library("INLA")
test2 <- capture.output(
{
inla(speed ~ dist, data = datasets::cars, verbose = T)
}
)

一些系统信息

sysname 
"Linux" 
release 
"4.19.0-16-cloud-amd64" 
version 
"#1 SMP Debian 4.19.181-1 (2021-03-19)" 

一些R版本信息

platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          6.3                         
year           2020                        
month          02                          
day            29                          
svn rev        77875                       
language       R                           
version.string R version 3.6.3 (2020-02-29)
nickname       Holding the Windsock  

我已经从help@r-inla.org.如果将verbose=F设置为默认值,则日志将存储在一个文件中。

> r=inla(y~1,data=data.frame(y=0))
> head(r$logfile)
[1] "        Read ntt 4 1 with max.threads 8"                          
[2] "        Found num.threads = 4:1 max_threads = 4"                  
[3] "        file: src/inla.c  4f8384f383a924449b14072dec7e4f9ce74ca121
- Wed Feb 16 14:16:16 2022 +0300"            
[4] "Report bugs to <help@r-inla.org>"                                 
[5] "Set reordering to id=[0] and name=[default]"                      
[6] "Process file[/tmp/Rtmpv5S9QO/file1c6414e8a909a/Model.ini]
threads[4] max.threads[8] blas_threads[1] nested[4:1]"

不得不说的是,因为在inla类文档或函数的详细参数中没有提到logfile元素。没有发现这个我并不觉得太难过。

最新更新