Error in library ggplot2 there is no package called ggplot2

I'm new to R and I'm just trying to get through some tutorials. When I try installing ggplot2, I get this error. Error in library(ggplot2) : There is no package called 'ggplot2' I tried these in R...

I’m new to R and I’m just trying to get through some tutorials.

When I try installing ggplot2, I get this error.

Error in library(ggplot2) : There is no package called 'ggplot2'

I tried these in R and RStudio.

install.packages("ggplot2", dep=T)

install.packages('ggplot2', repos='http://cran.us.r-project.org')

remove.packages("ggplot2")

but I get the error

(Error in remove.packages : there is no package called 'ggplot2')

This is what I get from install.packages(«ggplot2»)

> install.packages("ggplot2")
Installing package into ‘.../R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
  'lib = ".../R/win-library/3.4"' is not writable
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/ggplot2_2.2.1.zip'
Content type 'application/zip' length 2784566 bytes (2.7 MB)
downloaded 2.7 MB

package ‘ggplot2’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  cannot remove prior installation of package ‘ggplot2’

The downloaded binary packages are in
    C:...AppDataLocaltempRtmpqaGNprdownloaded_packages

I removed all ggplot2 files manually then tried to install again. Here’s my result.

> install.packages("ggplot2")
Installing package into ‘.../R/win-library/3.4’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://ftp.osuosl.org/pub/cran/bin/windows/contrib/3.4/ggplot2_2.2.1.zip'
Content type 'application/zip' length 2784566 bytes (2.7 MB)
downloaded 2.7 MB

package ‘ggplot2’ successfully unpacked and MD5 sums checked
Warning: unable to move temporary installation ‘...Rwin-library3.4file26b43a54980ggplot2’ to ‘...Rwin-library3.4ggplot2’

The downloaded binary packages are in
        C:...AppDataLocaltempRtmpq0T9a6downloaded_packages
> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’
> library("ggplot2")
Error in library("ggplot2") : there is no package called ‘ggplot2’

These code was run using R 3.4.2

Hi Stephen,
Following is the error message :

Error: package or namespace load failed for ‘ggplot2’ in
loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘rlang’
Traceback:

1. library(«ggplot2»)
2. tryCatch({
. attr(package, «LibPath») <- which.lib.loc
. ns <- loadNamespace(package, lib.loc)
. env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
. }, error = function(e) {
. P <- if (!is.null(cc <- conditionCall(e)))
. paste(» in», deparse(cc)[1L])
. else «»
. msg <- gettextf(«package or namespace load failed for %s%s:n %s»,
. sQuote(package), P, conditionMessage(e))
. if (logical.return)
. message(paste(«Error:», msg), domain = NA)
. else stop(msg, call. = FALSE, domain = NA)
. })
3. tryCatchList(expr, classes, parentenv, handlers)
4. tryCatchOne(expr, names, parentenv, handlers[[1L]])
5. value[[3L]](cond)
6. stop(msg, call. = FALSE, domain = NA)

Thank you for your help
Vidhu

Содержание

  1. > library(ggplot2) Error in library(ggplot2) : there is no package called ‘ggplot2’ #5
  2. Comments
  3. Как исправить в R: не удалось найти функцию «ggplot»
  4. Как воспроизвести эту ошибку
  5. Возможное исправление № 1: загрузите пакет ggplot2
  6. Возможное исправление № 2: установите ggplot2
  7. Возможное исправление № 3: установите ggplot2 с зависимостями
  8. Возможное исправление № 4: удалить и переустановить ggplot2
  9. Потенциальное исправление № 5: запустите правильный фрагмент кода
  10. Дополнительные ресурсы
  11. Ошибка в библиотеке (ggplot2): нет пакета с именем «ggplot2». Выполнение остановлено
  12. How to Fix: could not find function “ggplot” in R
  13. When this error might occur:
  14. Fixing the error:
  15. Ошибка: не удалось загрузить пакет или пространство имен для ggplot2 и data.table
  16. Установка пакетов в RStudio: исправление проблемы с путем установки

> library(ggplot2) Error in library(ggplot2) : there is no package called ‘ggplot2’ #5

library(ggplot2)
library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’

The text was updated successfully, but these errors were encountered:

It looks like you do not have the ggplot2 package installed. You can do this with the install.packages() function, which you can run from a Jupyter notebook or an R command prompt.

Along with many other sources, you can find more information here:

I tried install.packages (‘ggplot2’) , it does not work

Hi. We are not maintaining this course anymore. But, perhaps you can be a bit more specific about what ‘does not work’ means. What error message are you seeing.

Sorry, but I do not see any attachment. Can you just cut and paste the message as text?

Humm. I will not be able to reproduce this problem, but you might be missing the ‘rlang’ package, a dependency of ggplot2. Try:

Then install ggplot2.

I dont know what should I do ? it is error .. Can someone show me how ?

Warning in install.packages :
installation of package ‘scales’ had non-zero exit status
ERROR: dependency ‘scales’ is not available for package ‘ggplot2’

  • removing ‘C:/Users/Nikki Ayu Atamia/Documents/R/win-library/3.5/ggplot2’
    In R CMD INSTALL
    Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
‘C:UsersNikki Ayu AtamiaAppDataLocalTempRtmpMVoe6Kdownloaded_packages’

library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’

Источник

Как исправить в R: не удалось найти функцию «ggplot»

Одна ошибка, с которой вы можете столкнуться в R:

Эта ошибка возникает, когда вы пытаетесь создать график с помощью пакета визуализации данных ggplot2 , но не можете сначала загрузить пакет.

В этом руководстве объясняются пять возможных способов исправить эту ошибку.

Как воспроизвести эту ошибку

Предположим, мы запускаем следующий код в R:

Мы получаем сообщение об ошибке, потому что мы не загрузили пакет ggplot2 в нашу текущую среду R.

Возможное исправление № 1: загрузите пакет ggplot2

Самый распространенный способ исправить эту ошибку — просто загрузить пакет ggplot2 с помощью функции library() :

Во многих случаях это исправит ошибку.

Возможное исправление № 2: установите ggplot2

Если исправление №1 не работает, вам может потребоваться установить ggplot2 с помощью функции install.packages() :

Возможное исправление № 3: установите ggplot2 с зависимостями

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

Возможное исправление № 4: удалить и переустановить ggplot2

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

Потенциальное исправление № 5: запустите правильный фрагмент кода

Если ни одно из предыдущих исправлений не работает, вам может потребоваться просто убедиться, что вы используете правильный фрагмент кода в R, который фактически устанавливает и загружает пакет ggplot2.

Во многих случаях вы можете просто забыть запустить обе строки, которые устанавливают и загружают ggplot2 в R.

Дополнительные ресурсы

В следующих руководствах объясняется, как исправить другие распространенные ошибки в R:

Источник

Ошибка в библиотеке (ggplot2): нет пакета с именем «ggplot2». Выполнение остановлено

Я обновил свою систему с ubuntu 18.04 до 18.10. в моей предыдущей версии все работало нормально, но при обновлении были удалены все мои библиотеки R.

Я хочу их переустановить, но когда я пытаюсь установить что-нибудь, т.е.

Я получаю сообщение об отсутствии ggplot2, хотя я не пытаюсь его установить. На данный момент мне не удалось собрать ни одной библиотеки.

Я использую R version 3.5.1 (2018-07-02) — «Feather Spray» . это самая последняя версия.

Есть идеи, почему это происходит?

Без понятия. Это обычный сеанс R без загрузки старых рабочих пространств или файла Rprofile.site (или аналогичной конфигурации)?

Похоже, R пытается установить зависимости, которые не может найти. Кажется, вы используете другое репо, чем я (он работает на моей машине с Ubuntu). Можно попробовать install.packages(«data.table», repos = «https://cloud.r-project.org») ?

@Roland На самом деле я не знал, что такое vanilla R, обычно я просто нажимаю R в терминале и перехожу оттуда. Но я просто попытался запустить R —vanilla, и пакеты установились правильно. Но когда я возвращаюсь к тому, что начинаю с ‘R’, появляются те же ошибки.

Итак, R загружал что-то при запуске, как я и подозревал. Найдите загруженный файл и посмотрите его содержимое.

@JBGruber ggplot2 отсутствует в дереве зависимостей data.table.

@Roland — есть ли способ узнать, какие файлы R получает при запуске? Я еще не настроил профиль .R ..

Источник

How to Fix: could not find function “ggplot” in R

In this article, we will be looking at the approaches to fix the error: could not find function “ggplot”.

The R compiler throws this error when we try to generate a plot using the ggplot2 data visualization package, but couldn’t load the package first due to a failure. This article focuses on how we can fix this error. There are five different ways using which this error can be fixed:

When this error might occur:

Example:

Output:

The compiler produces such an error because we didn’t load the ggplot2 package in the R environment.

Fixing the error:

There are five different ways using which this error can be fixed.

Fix 1:

We can fix this error by loading the ggplot2 package with the help of the library function. The entire program is given below:

Output:

Fix 2:

If fix1 doesn’t work then there might be a possibility that ggplot2 is not installed in your system. We can install the package by using the below command in the R console:

Fix 3: Install ggplot2 with dependencies:

If fix 2 doesn’t work then it might be possible that the packages on which ggplot2 depends couldn’t be installed on the system. Thus, we need to install packages on which ggplot2 depends.

Fix 4: Reinstall ggplot2 after removing it once:

If the fix3 doesn’t work then we can try to remove the ggplot2 and reinstall it once again.

Fix 5: Execute the correct commands.

If the above four fixes don’t work then it might be possible that you are giving the wrong commands for installing and removing packages.

Источник

Ошибка: не удалось загрузить пакет или пространство имен для ggplot2 и data.table

Установка пакетов в RStudio: исправление проблемы с путем установки

Я не могу установить пакеты ggplot2 и data.table. Это дает мне следующую ошибку (пример для ggplot2)

Я смог нормально работать с этими двумя пакетами до того, как закрыл сеанс R. Теперь он показывает мне эту ошибку каждый раз, когда я пытаюсь ее запустить.

Я также пытался удалить и переустановить его, но безуспешно.

Я не уверен что не так

  • 4 Ваша проблема не в пакете ggplot2, а в пакете Rcpp.
  • 6 Прочтите сообщение об ошибке, и вы получите решение своей проблемы. Это хорошая идея использовать install.packages(‘ggplot2’, dependencies = TRUE) .
  • ой. Может тогда data.table? Или, может быть, происходило что-то невоспроизводимое, и это было пустой тратой награды.
  • 4 ggplot2 зависит от пяти десятков других вещей, некоторые из которых (масштабируются?) Используют скомпилированный код. Таким образом, тот факт, что ggplot2 предназначен только для R, — отвлекающий маневр.
  • 1 У меня была такая же проблема после установки Rcpp . Больше ничего не загружалось. Только что сделал install.packages(‘Rcpp’, dependencies = TRUE) снова и не нужно было связываться ни с одним из моих других пакетов.

+50

Это решило проблему:

  • 1 dependencies=TRUE не требуется, эта установка предлагает рекомендуемые действия, которые не являются обязательными для пакетов R

После безумной погони с кучей поисковых запросов в Google и попыток взлома я думаю, что нашел, как решить эту проблему.

Шаги, предпринятые для решения проблемы:

  1. Удалить R
  2. Переустановите R

Установите ggplot с аргументом dependencies для install.packages, установленным в TRUE

Вышеупомянутый шаг по-прежнему НЕ включает зависимость Rcpp, поэтому ее необходимо установить вручную с помощью следующей команды

Однако, хотя приведенная выше команда успешно загружает Rcpp, по какой-то причине ей не удается взорвать ZIP-файл и установить его в папку моей библиотеки R, ссылаясь на следующую ошибку:

пакет ‘Rcpp’ успешно распакован и суммы MD5 проверены Предупреждение в install.packages: невозможно переместить временную установку ‘C: Root_Prgs Data_Science_SW R R-3.2.3 library file27b8ef47b6d Rcpp’ в ‘C: Root_Prgs Data_Science_SW R R-3.2.3 library Rcpp ‘

Загруженные бинарные пакеты находятся в C: Users MY_USER_ID AppData Local Temp Rtmp25XQ0S loaded_packages

  1. Обратите внимание, что в приведенных выше выходных данных написано «Предупреждение», но на самом деле это показатель неудачной установки пакета Rcpp в репозитории. Затем я использовал Инструменты -> Установить пакеты -> Из ZIP-файла и указал на расположение «загруженных двоичных пакетов» в сообщении выше —

Это привело к успешной установке Rcpp в мою папку R R-3.2.3 library, тем самым гарантируя, что Rcpp теперь доступен, когда я пытаюсь загрузить библиотеку для ggplot2. Раньше я не мог выполнить этот шаг, потому что моя предыдущая установка R вызвала бы ошибку о невозможности импорта Rcpp. Однако эта же команда работала после того, как я удалил и переустановил R, который является ODD.

install.packages («C: /Users/MY_USER_ID/AppData/Local/Temp/Rtmp25XQ0S/downloaded_packages/Rcpp_0.12.3.zip», repos = NULL, type = «win.binary») пакет ‘Rcpp’ успешно распакован и суммирует MD5 проверено

Наконец-то мне удалось успешно загрузить библиотеку ggplot2.

  • 30 это не совсем «решение проблемы», это как убийство плюс побег на другой конец планеты под новым именем 😉

Я тоже столкнулся с той же проблемой и

у меня эти команды не работали. Я обнаружил, что он показывал предупреждающее сообщение о том, что не может переместить временную установку. C:UsersUser_nameDocumentsRwin-library3.3abcd1234Rcpp к C:UsersUser_nameDocumentsRwin-library3.3Rcpp .

Я загрузил zip-файл Rcpp по указанной ссылке, разархивировал его и скопировал внутрь C:UsersUser_nameDocumentsRwin-library3.3 а потом

работал. Мне не нужно было удалять R. Надеюсь, это поможет.

  • Благодарность! У меня тоже сработало. Хотя мне пришлось вручную изменить имя пакета на «Rcpp» в каталоге файлов Windows, чтобы оно соответствовало R, и переместить файлы на один уровень вверх в каталоге файлов Windows. Рад, что мне не пришлось все удалять.

Столкнулся с той же проблемой и решил:

когда ты видишь

Вы хотите установить из исходников пакет, требующий компиляции? (Да / нет / отменить)

  • 7 Разве вы не можете установить их все одной командой? Кроме того, разве им не нужно просто установить Rcpp? Или укажите dependencies = TRUE при установке в первую очередь?

Я попробовал шаги, упомянутые в предыдущих сообщениях, но безуспешно. Однако то, что сработало для меня, — это полное удаление R, а затем удаление папки R, файлы в папке с документами, поэтому в основном с R работает все, кроме сценариев и рабочих пространств, которые я сохранил. Затем я переустановил R и запустил

Этот довольно грубый метод как-то у меня сработал.

  • Я сделал нечто подобное, просто скопировал соответствующие файлы в новую папку и создал новый проект. Работает неплохо.

Я попробовал все перечисленные выше решения, но ничего не помогло. Это то, что у меня сработало.

  1. Посмотрите полное сообщение об ошибке, которое вы получаете при использовании библиотеки (ggplot2).
  2. В нем перечислены несколько пакетов, которые отсутствуют или содержат ошибки.
  3. Удалите и переустановите их.
  4. ggplot теперь должен работать с предупреждением о версии.

Эти шаги работают для меня:

  1. Загрузите Rcpp вручную с веб-сайта (https://cran.r-project.org/web/packages/Rcpp/index.html)
  2. распаковать папку / файлы в папку «Rcpp»
  3. Найдите папку «библиотека» в каталоге установки R Пример: C: R R-3.3.1 library
  4. Скопируйте папку «Rcpp» в папку библиотеки.

Хорошо пойти.

Для меня мне пришлось удалить R из brew brew uninstall —force R а затем перейдите на веб-сайт R, загрузите и установите его оттуда.

У меня была такая же проблема, но при запуске в ноутбуке jupyter R в среде Anaconda.

Проблема была представлена ​​таким образом, что любой открытый блокнот R мгновенно умирает и не допускает выполнения ячейки. Ошибка будет появляться при каждой неудачной автоматической попытке запустить ядро:

Чтобы решить эту проблему, я запустил как admin / sudo: conda install -c r r-rcpp , перезапустил ядро, и все вернулось к норме.

У меня была такая же проблема с пакетом «tidyverse». Я решил проблему с 1. удалением пакета «Rcpp» и «tidyverse» 2. переустановкой «Rcpp» и ответом на следующие вопросы в процессе установки:

Источник

  • Remove From My Forums
  • Question

  • Hello. I am trying to get the R integration working in SQL 2016 CTP 3.2. The base functionality of R works, this statement works fine and returns 1:

    sp_execute_external_script

    @language =N’R’,

    @script =N’OutputDataSet
    <- InputDataSet’
    ,

    @input_data_1
    =N’SELECT
    1 as Col’
    WITHRESULT
    SETS
    ((col
    intnotnull));

    When I run an R Script that works fine in RStudio or Open R that references ggplot2 I get this error:

    Msg 39004, Level 16, State 20, Line 4

    A ‘R’ script error occurred during execution of ‘sp_execute_external_script’ with HRESULT 0x80004004.

    Msg 39019, Level 16, State 1, Line 4

    An external script error occurred:

    Error in library(ggplot2, quietly = TRUE) :

    there is no package called ‘ggplot2’

    Calls: source -> withVisible -> eval -> eval -> library

    Error in ScaleR. Check the output for more information.

    Error in sqlSatelliteCall() :

    Error in executing R code: transform function

    Calls: sqlSatelliteCall -> .Call

    Execution halted

    ******

    Any ideas of where my problem lies?

    thanks!

    Rick

Answers

  • R process under SQL does not have access to user profile library path. Check if ggplot2 package was installed under a user profile library path (like
    R_LIBS_USER) using the command:

    find.package("ggplot2")

    If so, you would need to remove and install into the default library path (.Library), so the package is available for the SQL/R process. To check what packages are available to SQL/R you use the following command:

    sp_execute_external_script @language = N'R', @script = N'OutputDataSet <- data.frame(installed.packages())'
    • Edited by

      Wednesday, March 16, 2016 11:38 PM

    • Marked as answer by
      infomod
      Wednesday, March 16, 2016 11:48 PM

Has anybody managed to call ggplot functions successfully using RLink?

I’ve tried the following in Windows 10 with Mathematica 11.3;

In[7]:= Needs@"RLink`"

In[11]:= InstallR["RHomeLocation" -> "C:\Program Files\R\R-3.4.1"]

In[9]:= REvaluate["examData<-read.delim("C:/Users/robertn/Documents/
Wolfram Mathematica/DSUR/Exam Anxiety.dat", header = T)"]

Out[9]= RDataFrame[
 RNames["Code", "Revise", "Exam", "Anxiety", "Gender"], 
 RData[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
    19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 
   35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
    52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 
   68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
    85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 
   101, 102, 103}, {4, 11, 27, 53, 4, 22, 16, 21, 25, 18, 18, 16, 13, 
   18, 98, 1, 14, 29, 4, 23, 14, 12, 22, 84, 23, 26, 24, 72, 37, 10, 
   3, 36, 43, 19, 12, 9, 72, 10, 12, 30, 15, 8, 34, 22, 21, 27, 6, 18,
    8, 19, 0, 52, 38, 19, 23, 11, 27, 17, 13, 42, 4, 8, 6, 11, 7, 15, 
   4, 28, 22, 29, 2, 16, 59, 10, 13, 8, 5, 2, 38, 4, 10, 6, 68, 8, 1, 
   14, 42, 13, 1, 3, 5, 12, 19, 2, 19, 11, 15, 23, 13, 14, 1, 9, 
   20}, {40, 65, 80, 80, 40, 70, 20, 55, 50, 40, 45, 85, 70, 50, 95, 
   70, 95, 95, 50, 60, 80, 75, 85, 90, 30, 60, 75, 75, 27, 20, 75, 90,
    60, 30, 80, 10, 85, 7, 5, 85, 20, 45, 60, 70, 50, 25, 50, 40, 80, 
   50, 35, 80, 50, 49, 75, 25, 65, 80, 50, 70, 40, 80, 10, 20, 40, 40,
    70, 52, 50, 60, 80, 60, 65, 15, 85, 20, 80, 100, 100, 80, 10, 70, 
   100, 70, 70, 65, 75, 85, 30, 5, 10, 90, 70, 20, 85, 35, 30, 70, 55,
    75, 2, 40, 50}, {86.298, 88.716, 70.178, 61.312, 89.522, 60.506, 
   81.462, 75.82, 69.372, 82.268, 79.044, 80.656, 70.178, 75.014, 
   34.714, 95.164, 75.82, 79.044, 91.134, 64.536, 80.656, 77.432, 
   65.342, 0.056, 71.79, 81.462, 63.73, 27.46, 73.402, 89.522, 89.522,
    75.014, 43.58, 82.268, 79.044, 79.044, 37.132, 81.462, 83.074, 
   50.834, 82.268, 78.238, 72.596, 74.208, 75.82, 70.984, 97.582, 
   67.76, 75.014, 73.402, 93.552, 58.894, 53.252, 84.686, 89.522, 
   71.79, 82.268, 69.372, 62.118, 68.566, 93.552, 84.686, 82.268, 
   81.462, 82.268, 91.134, 91.94, 86.298, 72.596, 63.73, 63.73, 71.79,
    57.282, 84.686, 84.686, 77.432, 82.268, 10., 50.834, 87.91, 83.88,
    84.686, 20.206, 87.104, 83.88, 67.76, 95.97, 62.118, 84.686, 
   92.746, 84.686, 83.074, 73.402, 87.91, 71.79, 86.298, 84.686, 
   75.82, 70.984, 78.238, 82.268, 79.044, 91.134}, 
  RFactor[{2, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 1, 1, 2,
     2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 1,
     2, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1,
     2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2,
     1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1}, 
   RFactorLevels["Female", "Male"]]], 
 RRowNames[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 
  18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 
  35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 
  52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 
  69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 
  86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 
  102, 103]]

In[13]:= REvaluate@"install.packages("ggplot2")"

In[15]:= REvaluate@"library(ggplot2)"

This last step is where it falls down. (The penultimate expression manages to bring up a dialog on which mirror to download the package from and then installation begins, including what I assume are dependencies.) The message I get on executing the last expression is;

REvaluate::rerr: Failed to retrieve the value for variable or piece of code library(ggplot2). 
The following R error was encountered: 
Error in library(ggplot2) : there is no package called 'ggplot2'

thanks

Errors about ggplot2 packages of R language install in Ubuntu server

Hello everyone

I tried to install ggplots packages of R in Ubuntu server, but there were some errors which displayed as follows:

Warning messages:
1:In install.packages("ggplot2"):
Installation of package 'plyr' had non-zero exit status

2: In install.packages("ggplot2"):
Installation of package 'reshape2' had non-zero exit status

3: In install.packages("ggplot2"):
Installation of package 'scales' had non-zero exit status

4: In install.packages("ggplot2"):
Installation of package 'ggplot2' had non-zero exit status

Then I tried to use ggplot2 through command:

library('ggplot2')

But terminal told me that

Error in library (ggplot2): there is no package called 'ggplot2'

I have found many information about this problem on internet, but no available ways find and error was error.

If you have some suggestion, please tell me.

Thanks for your help.

R

ggplot2

Ubuntu server

• 37k views

You need to install Rcpp first. I’m a bit surprised this wasn’t done automagically.

It seems that you are using a very old version R; so, even if you succeed in installing ggplot2, be aware that it may not work correctly afterwards. In any case, to solve the issue you should install Rcpp separately — e.g. sudo apt-get install r-cran-rcpp

Login before adding your answer.

Traffic: 2406 users visited in the last hour

Hey all,

I’m trying to do some forcasting and downloaded the custom visual ‘Time Series Forecasting Chart’. I subsequently had to download R 3.4.3.

However, when i come to populate the chart i receive the following error. Does anyone have any clues as to why this has gone wrong?

Thank you!

——————————————————

Feedback Type:

Frown (Error)

Timestamp:

2018-03-22T17:09:36.4916522Z

Local Time:

2018-03-22T17:09:36.4916522+00:00

Session ID:

b37894b6-dbcd-4dd5-acd2-a45c3344368d

Release:

March, 2018

Product Version:

2.56.5023.1021 (PBIDesktop) (x64)

Error Message:

R script error.

Loading required package: XML

Warning messages:

1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :

there is no package called ‘XML’

2: In libraryRequireInstall(«XML») :

*** The package: ‘XML’ was not installed ***

Loading required package: htmlwidgets

Warning messages:

1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :

there is no package called ‘htmlwidgets’

2: In libraryRequireInstall(«htmlwidgets») :

*** The package: ‘htmlwidgets’ was not installed ***

Loading required package: ggplot2

Warning messages:

1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :

there is no package called ‘ggplot2’

2: In libraryRequireInstall(«ggplot2») :

*** The package: ‘ggplot2’ was not installed ***

Loading required package: plotly

Warning messages:

1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :

there is no package called ‘plotly’

2: In libraryRequireInstall(«plotly») :

*** The package: ‘plotly’ was not installed ***

Loading required package: scales

Warning messages:

1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :

there is no package called ‘scales’

2: In libraryRequireInstall(«scales») :

*** The package: ‘scales’ was not installed ***

Loading required package: forecast

Warning messages:

1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :

there is no package called ‘forecast’

2: In libraryRequireInstall(«forecast») :

*** The package: ‘forecast’ was not installed ***

Loading required package: zoo

Warning messages:

1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :

there is no package called ‘zoo’

2: In libraryRequireInstall(«zoo») :

*** The package: ‘zoo’ was not installed ***

Loading required package: ggplot2

Warning messages:

1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :

there is no package called ‘ggplot2’

2: In libraryRequireInstall(«ggplot2») :

*** The package: ‘ggplot2’ was not installed ***

Error in ggplot() : could not find function «ggplot»

Execution halted

Я новичок в R, и я просто пытаюсь пройти некоторые уроки.

Когда я пытаюсь установить ggplot2, я получаю эту ошибку.

Error in library(ggplot2) : There is no package called 'ggplot2'

Я попробовал это в R и RStudio.

install.packages("ggplot2", dep=T)

install.packages('ggplot2', repos='http://cran.us.r-project.org')

remove.packages("ggplot2")

Но я получаю ошибку

(Error in remove.packages : there is no package called 'ggplot2')

Это то, что я получаю из install.packages («ggplot2»)

> install.packages("ggplot2")
Installing package into ‘.../R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
  'lib = ".../R/win-library/3.4"' is not writable
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/ggplot2_2.2.1.zip'
Content type 'application/zip' length 2784566 bytes (2.7 MB)
downloaded 2.7 MB

package ‘ggplot2’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  cannot remove prior installation of package ‘ggplot2’

The downloaded binary packages are in
    C:...AppDataLocaltempRtmpqaGNprdownloaded_packages

Я удалил все файлы ggplot2 вручную, затем попытался установить снова. Вот мой результат.

> install.packages("ggplot2")
Installing package into ‘.../R/win-library/3.4’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://ftp.osuosl.org/pub/cran/bin/windows/contrib/3.4/ggplot2_2.2.1.zip'
Content type 'application/zip' length 2784566 bytes (2.7 MB)
downloaded 2.7 MB

package ‘ggplot2’ successfully unpacked and MD5 sums checked
Warning: unable to move temporary installation ‘...Rwin-library3.4file26b43a54980ggplot2’ to ‘...Rwin-library3.4ggplot2’

The downloaded binary packages are in
        C:...AppDataLocaltempRtmpq0T9a6downloaded_packages
> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’
> library("ggplot2")
Error in library("ggplot2") : there is no package called ‘ggplot2’
> 

3 ответа

Лучший ответ

Меры

  1. Перейти к инструментам

  2. Установить пакеты

  3. В текстовом поле «Типы пакетов» ggplot2

  4. Установите флажок установить зависимости


7

Bill the Lizard
31 Июл 2018 в 16:55

Попробуйте запустить R-клиент непосредственно из командной строки, а затем выполните инструкцию: install.packages («ggplot2», lib = «C: /Users/YourUser/Documents/R/win-library/3.3»)


1

Renaud
23 Ноя 2018 в 22:18

Понравилась статья? Поделить с друзьями:
  • Error in java launcher no acceptable jvms were found
  • Error in is finite x default method not implemented for type list
  • Error in invoking target client sharedlib of makefile
  • Error in install packages updating loaded packages
  • Error in initializing st link device reason target held under reset