Thanks, I tried to restart R and reinstall rstan and StanHeaders from source according to the installation guide but it produced the following message:
installing source package ‘StanHeaders’ …
** package ‘StanHeaders’ successfully unpacked and MD5 sums checked
ERROR: cannot remove earlier installation, is it in use?
restoring previous ‘C:/Users/AndreasNi/AppData/Local/R/win-library/4.2/StanHeaders’
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
problem copying C:\Users\AndreasNi\AppData\Local\R\win-library\4.2\00LOCK-StanHeaders\StanHeaders\libs\x64\StanHeaders.dll to C:\Users\AndreasNi\AppData\Local\R\win-library\4.2\StanHeaders\libs\x64\StanHeaders.dll: Permission denied
Warning in install.packages :
installation of package ‘StanHeaders’ had non-zero exit status
installing source package ‘rstan’ …
** package ‘rstan’ successfully unpacked and MD5 sums checked
ERROR: cannot remove earlier installation, is it in use?
restoring previous ‘C:/Users/AndreasNi/AppData/Local/R/win-library/4.2/rstan’
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
problem copying C:\Users\AndreasNi\AppData\Local\R\win-library\4.2\00LOCK-rstan\rstan\libs\x64\rstan.dll to C:\Users\AndreasNi\AppData\Local\R\win-library\4.2\rstan\libs\x64\rstan.dll: Permission denied
Warning in install.packages :
installation of package ‘rstan’ had non-zero exit status