Search code examples
rr-sfrenvr-environment

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


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]

Solution

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

    Sys.setenv(RENV_DOWNLOAD_FILE_METHOD = "libcurl")