ошибка при установке пакетов в R или RStudio - PullRequest
0 голосов
/ 30 мая 2018

Я недавно установил R и Rstudio на мой компьютер Mac (обе являются последней версией).Но у меня была ошибка ниже при попытке установить пакеты.

Я пытался установить пакеты как в R, так и в RStudio, как из командной строки, так и из меню «Установить пакет», ни один из этих способов не работает.

Я также пытался использовать опции (repos = c (CRAN = "URL")) с разными URL, но все равно получал ту же ошибку.

R version 3.5.0 (2018-04-23) -- "Joy in Playing"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[R.app GUI 1.70 (7521) x86_64-apple-darwin15.6.0]

> a <- available.packages()
--- Please select a CRAN mirror for use in this session ---
Warning: failed to download mirrors file (cannot open URL 'https://cran.r-project.org/CRAN_mirrors.csv'); using local file '/Library/Frameworks/R.framework/Resources/doc/CRAN_mirrors.csv'

Warning message:
In download.file(url, destfile = f, quiet = TRUE) :
URL 'https://cran.r-project.org/CRAN_mirrors.csv': status was 'Couldn't connect to server'

> install.packages('ggplot2', repos='http://cran.us.r-project.org')
> options(repos = c(CRAN = "http://cran.rstudio.com"))
> install.packages('ggplot2')
Warning: unable to access index for repository http://cran.rstudio.com/src/contrib:
cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'
Warning: unable to access index for repository http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5:
cannot open URL 'http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
> options(repos = c(CRAN = "http://cloud.r-project.org/"))
> install.packages('ggplot2')
Warning: unable to access index for repository http://cloud.r-project.org/src/contrib:
cannot open URL 'http://cloud.r-project.org/src/contrib/PACKAGES'
Warning: unable to access index for repository http://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.5:
cannot open URL 'http://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
> 

Ваша помощь будет высоко оценена.

Спасибо!

...