쌩뚱맞은 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")
실행하면 됨