I can't install the sf package when I use the renv package in a project

1k views Asked by At

I started a new project in Rstudio and selected the option to use renv. The first thing I did was type the command install.packages('sf') and R returned the message below. How to proceed?

> 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]
2

There are 2 answers

0
Igor On BEST ANSWER

As @KevinUshey pointed, I was able to download it with:

Sys.setenv(RENV_DOWNLOAD_FILE_METHOD = "libcurl")
0
Daniel Vartanian On

The same thing happened to me.

In the end, I found that the Avast Ransomware Module was blocking the connection. Try disabling your antivirus and see what happens.