Ggplot2 не удается установить на R 3.0.2

Я не могу установить ggplot2 в R 3.0.2 на Ubuntu.

Когда я запустил

install.packages('ggplot2',dependencies = TRUE)

Я получаю следующую ошибку.

 > install.packages('ggplot2',dependencies = TRUE)
Installing package into ‘/home/gowthamn/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependencies ‘plyr’, ‘testthat’ are not available
also installing the dependencies ‘reshape2’, ‘scales’, ‘Hmisc’

trying URL 'http://cran.rstudio.com/src/contrib/reshape2_1.4.1.tar.gz'
Content type 'application/x-gzip' length 34693 bytes (33 Kb)
opened URL
==================================================
downloaded 33 Kb

trying URL 'http://cran.rstudio.com/src/contrib/scales_0.2.4.tar.gz'
Content type 'application/x-gzip' length 40093 bytes (39 Kb)
opened URL
==================================================
downloaded 39 Kb

trying URL 'http://cran.rstudio.com/src/contrib/Hmisc_3.16-0.tar.gz'
Content type 'application/x-gzip' length 629536 bytes (614 Kb)
opened URL
==================================================
downloaded 614 Kb

trying URL 'http://cran.rstudio.com/src/contrib/ggplot2_1.0.1.tar.gz'
Content type 'application/x-gzip' length 2351203 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb

ERROR: dependency ‘plyr’ is not available for package ‘reshape2’
    * removing ‘/home/gowthamn/R/x86_64-pc-linux-gnu-library/3.0/reshape2’
    Warning in install.packages :
      installation of package ‘reshape2’ had non-zero exit status
    ERROR: dependency ‘plyr’ is not available for package ‘scales’
    * removing ‘/home/gowthamn/R/x86_64-pc-linux-gnu-library/3.0/scales’
    Warning in install.packages :
      installation of package ‘scales’ had non-zero exit status
    ERROR: dependencies ‘plyr’, ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
    * removing ‘/home/gowthamn/R/x86_64-pc-linux-gnu-library/3.0/ggplot2’
    Warning in install.packages :
      installation of package ‘ggplot2’ had non-zero exit status
    ERROR: dependencies ‘ggplot2’, ‘scales’ are not available for package ‘Hmisc’
    * removing ‘/home/gowthamn/R/x86_64-pc-linux-gnu-library/3.0/Hmisc’
    Warning in install.packages :
      installation of package ‘Hmisc’ had non-zero exit status

Я также пробовал

install.packages(c('reshape2','scales'))

Получить сообщение об ошибке plyr.

Я также обновил Ubuntu, а также переустановил последнюю версию R и обновил пакеты с помощью update.packages(checkBuilt=TRUE). Но ничего не получилось. Что я могу сделать?

Ответы

Ответ 1

Если вам не нужна последняя версия, вы можете установить упакованную версию, распространяемую Ubuntu, используя:

sudo apt-get install r-cran-ggplot2

Ответ 2

Я исправил эту проблему, набрав следующую команду:

$ sudo apt-get install r-cran-plyr
$ sudo apt-get install r-cran-reshape2

Ответ 3

Вы должны обновить свою версию R (r-base) до последней. Командная строка вроде:

$ sudo apt-get update
$ sudo apt-get install r-base

обновлено не работает для меня.

  • Сначала удалите R.
  • Затем загрузите файл 3.2.1 deb из ссылки: http://cran.es.r-project.org/bin/linux/ubuntu/trusty/
  • Установите его в программный центр Ubuntu.
  • Запустите install.packages как обычный.

Ответ 4

apt-get отслеживает, какие репозитории ищут пакеты в /etc/apt/sources.list. Установленный по умолчанию набор, определенный большинством людей, не содержит зеркал CRAN. Для пользователей Ubuntu вы можете добавить следующую строку в /etc/apt/sources.list:

deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu <linux ver>/

Я использую "надежную" версию Ubuntu и предпочитаю зеркало крана беркли, поэтому моя строка выглядит так:

deb http://cran.cnr.berkeley.edu/bin/linux/ubuntu trusty/

Если вам нужно узнать версию Ubuntu, попробуйте запустить:

lsb_release -a

Теперь apt-get может взаимодействовать с зеркалом CRAN для вас. Наслаждайтесь!

Ответ 5

Загрузите самую новую версию r-base (3.2.2) из ​​[http://cran.es.r-project.org/bin/linux/ubuntu/trusty/] используйте программный центр Ubuntu, чтобы открыть его и установить. Это позволит обновить уже установленную версию до последней версии. Затем попробуйте снова установить ggplot2. Это работало для меня как магия. Удачи вам!