Error in is.null(data) || is.na(data)

24 views
Skip to first unread message

xinx...@126.com

unread,
Aug 29, 2025, 12:27:36 AM8/29/25
to hbayesdm-users

Dear list,

I am having trouble solve this error, it said here two years ago that it is a bug of the package, what is the solution now?

> library(hBayesDM)
Loading required package: Rcpp
This is hBayesDM version 1.2.1
Warning message:
package ‘hBayesDM’ was built under R version 4.5.1 
> d=data.frame(subjID=c(rep(1:10,each=100)),ntrials=rep(1:100,10),choice=sample(c(1,2),size=1000,replace = T),outcome=sample(c(1,-1),size=1000,replace = T))
> fit=bandit2arm_delta(data=d)
Error in is.null(data) || is.na(data) : 
  'length = 4000' in coercion to 'logical(1)'

Eunhwi Lee

unread,
Sep 6, 2025, 4:00:14 AM9/6/25
to hbayesdm-users
Dear Ya,

Could you try installing the developer version using the following command:
devtools::install_github("CCS-Lab/hBayesDM", subdir="R") ?

The errors you encountered should be resolved in this updated version.

Best,
Eunhwi

2025년 8월 29일 금요일 오전 6시 27분 36초 UTC+2에 YA님이 작성:

xinx...@126.com

unread,
Sep 9, 2025, 4:15:34 AM9/9/25
to Eunhwi Lee, hbayesdm-users
Dear Eunhwi,

Thank you very much for the response.

Here is the code and error. I am on windows 11, and I ran the code as the administrator.


> devtools::install_github("CCS-Lab/hBayesDM", subdir="R",force=T) 
Downloading GitHub repo CCS-Lab/hBayesDM@HEAD
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  
  
  
   checking for file 'C:\Users\HUAWEI\AppData\Local\Temp\RtmpmCXaEI\remotes5bf87ec56b7a\CCS-Lab-hBayesDM-6a52ceb\R/DESCRIPTION' ...
  
✔  checking for file 'C:\Users\HUAWEI\AppData\Local\Temp\RtmpmCXaEI\remotes5bf87ec56b7a\CCS-Lab-hBayesDM-6a52ceb\R/DESCRIPTION' (579ms)

  
Warning in file.copy(pkgname, Tdir, recursive = TRUE, copy.date = TRUE) :
  
   Warning in file.copy(pkgname, Tdir, recursive = TRUE, copy.date = TRUE) :
     problem copying .\R\inst\extdata to C:\Users\HUAWEI\AppData\Local\Temp\RtmpqMtSzm\Rbuild588043a21a61\R\inst\extdata: Permission denied

  
Warning in file.copy(pkgname, Tdir, recursive = TRUE, copy.date = TRUE) :
  
   Warning in file.copy(pkgname, Tdir, recursive = TRUE, copy.date = TRUE) :
     problem copying .\R\inst\stan_files to C:\Users\HUAWEI\AppData\Local\Temp\RtmpqMtSzm\Rbuild588043a21a61\R\inst\stan_files: Permission denied

    ERROR
   copying to build directory failed

Error: Failed to install 'hBayesDM' from GitHub:
  ! System command 'Rcmd.exe' failed






What permission do I need? The package installation from CRAN did not have this permission problem.

Best regards,

YA


--
You received this message because you are subscribed to the Google Groups "hbayesdm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbayesdm-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hbayesdm-users/670df5e8-241a-4992-a5a1-4dcdc8a617c2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages