我在Rstudio中启动了一个新项目,并选择使用renv。我做的第一件事是输入命令install.packages('sf'), R返回下面的消息。如何继续?
> install.packages('sf')
Error: package 'sf' is not available
In addition: Warning messages:
1: could not retrieve available packages for url "https://cran.rstudio.com/src/contrib"
2: could not retrieve available packages for url "https://cran.rstudio.com/bin/windows/contrib/4.1"
3: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - A função de revogação não pôde verificar a revogação do certificado.
4: package 'sf' is not available
5: failed to retrieve 'https://rstudio-buildtools.s3.amazonaws.com/renv/mran/packages.rds' [error code 35]
正如@KevinUshey所指出的,我能够通过以下方式下载它:
Sys.setenv(RENV_DOWNLOAD_FILE_METHOD = "libcurl")
同样的事情也发生在我身上。
最后,我发现Avast勒索软件模块阻塞了连接。试试禁用杀毒软件,看看会发生什么。