Ik ben nieuw bij R en ik probeer alleen wat tutorials door te nemen.
Als ik ggplot2 probeer te installeren, krijg ik deze foutmelding.
Error in library(ggplot2) : There is no package called 'ggplot2'
Ik heb deze geprobeerd in R en RStudio.
install.packages("ggplot2", dep=T)
install.packages('ggplot2', repos='http://cran.us.r-project.org')
remove.packages("ggplot2")
maar ik krijg de foutmelding
(Error in remove.packages : there is no package called 'ggplot2')
Dit krijg ik van 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:...\AppData\Local\temp\RtmpqaGNpr\downloaded_packages
Ik heb alle ggplot2-bestanden handmatig verwijderd en probeerde vervolgens opnieuw te installeren. Dit is mijn resultaat.
> 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 ‘...\R\win-library\3.4\file26b43a54980\ggplot2’ to ‘...\R\win-library\3.4\ggplot2’
The downloaded binary packages are in
C:...\AppData\Local\temp\Rtmpq0T9a6\downloaded_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’
>
Antwoord 1, Autoriteit 100%
Bij dit probleem zou ik voorstellen:
- Probeer het uit te schakelen en weer op
- Update r tot laatste versie indien mogelijk
- Handmatig verwijderen Alle mappen met betrekking tot het relevante pakket en probeer het opnieuw met de installatie
- Wijzig uw standaard bibliotheeklocatie: Hoe verandert u bibliotheeklocatie in R?
Antwoord 2, Autoriteit 1000%
Stappen
-
Ga naar Extra
-
Installeer pakketten
-
In pakketten Tekstvak Type
ggplot2
-
Controleer de afhankelijkheden van het selectievakje Installeer
Antwoord 3, Autoriteit 100%
Probeer R-client rechtstreeks van de opdrachtprompt te starten en geeft vervolgens de instructie uit:
Installeer.packages (“GGPLOT2”, LIB = “C: /USERS/YOURUSER/DOCUMENTS/R/WIN-LIBRARY/3.3”)
Antwoord 4, Autoriteit 100%
U moet uw R-versie updaten en dit doen, maar u moet alle pakketten opnieuw installeren:
Tool & GT; Globale opties & GT; R-versie (wijzigen) & GT; Selecteer “Gebruik de standaardversie van R …”