본문 바로가기
연구 노트/R Python

unable to access index for repository https://mran.microsoft.com/snapshot/

by Dr. STEAM 2023. 9. 4.
반응형

쌩뚱맞은 microsoft.com 에러?

 

에러 발생

> install.packages("ggplot2")
Warning in install.packages :
  unable to access index for repository https://mran.microsoft.com/snapshot/2020-07-16/src/contrib:
  URL 'https://mran.microsoft.com/snapshot/2020-07-16/src/contrib/PACKAGES'를 열 수 없습니다
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/chpark/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
  unable to access index for repository https://mran.microsoft.com/snapshot/2020-07-16/src/contrib:
  URL 'https://mran.microsoft.com/snapshot/2020-07-16/src/contrib/PACKAGES'를 열 수 없습니다
Warning in install.packages :
  package ‘ggplot2’ is not available (for R version 4.0.2)
Warning in install.packages :
  unable to access index for repository https://mran.microsoft.com/snapshot/2020-07-16/bin/windows/contrib/4.0:
  URL 'https://mran.microsoft.com/snapshot/2020-07-16/bin/windows/contrib/4.0/PACKAGES'를 열 수 없습니다

 

해결

아래 script 실행

local({r <- getOption("repos")
       r["CRAN"] <- "http://cran.r-project.org"
       options(repos=r)})

 

이후 

> install.packages("ggplot2") 

실행하면 됨

 

 

 

 

참고: https://learn.microsoft.com/en-us/answers/questions/544231/unable-to-access-mran-is-there-currently-any-probl

 

Unable to access MRAN: is there currently any problem on your server? - Microsoft Q&A

Hello, I tried to install a package today from MRAN but it failed. Here is the error message: Warning in install.packages : unable to access index for repository https://mran.microsoft.com/snapshot/2020-07-16/src/contrib: cannot open URL…

learn.microsoft.com

 

728x90
반응형