我正在尝试更新R-4.2.2中的terra
包,我遇到了以下问题;
Warning message:
In file.copy(savedcopy, lib, recursive = TRUE) :
problem copying C:UsersxxxxxDocumentsRwin-library4.2 0LOCKterralibsx64terra.dll
to C:UsersxxxxxDocumentsRwin-library4.2terralibsx64terra.dll: Permission denied
这已经在install.packages("terra")
,install.packages('terra', repos='https://rspatial.r-universe.dev')
中尝试过和install.packages('terra', repos='https://rspatial.r-universe.dev', INSTALL_opts = '--no-lock')
-得到相同的结果
根据许多建议,我已经去寻找00LOCK文件删除它并再次尝试,但它不存在我可以找到它的任何地方。
我的问题的根源是dismo
需要raster
v3.5.21,并且更新raster
以便它遵守terra
下载的调用,这是错误的。
‘package ‘raster’ 3.5.15 is loaded, but >= 3.5.21 is required by ‘dismo’’
> sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
关闭R(和R- studio),并删除此文件夹:
C:UsersxxxxxDocumentsRwin-library4.2terra
如果存在,也要删除这些文件夹。
C:UsersxxxxxDocumentsRwin-library4.2 0LOCK-terra
C:UsersxxxxxDocumentsRwin-library4.2 0LOCK
然后打开R并安装"terra">