Willkommen Gast. Bitte einloggen oder registrieren. Haben Sie Ihre Aktivierungs E-Mail übersehen?
20.10.2019, 19:29:56

.
Einloggen mit Benutzername, Passwort und Sitzungslänge

Mitglieder
  • Mitglieder insgesamt: 22698
  • Letzte: peshku
Statistiken
  • Beiträge insgesamt: 614420
  • Themen insgesamt: 49655
  • Heute online: 780
  • Am meisten online: 992
  • (17.11.2018, 20:17:55)
Benutzer Online

Autor Thema: [gelöst]  RStudio kann keine Pakete installieren  (Gelesen 931 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

[gelöst] RStudio kann keine Pakete installieren
« am: 31.08.2018, 12:09:52 »
Zimtmint 19

R und RStudio sind installiert.
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

RStudio
Version 1.1.447

Wenn ich mein (in Win erstelltes Skript) starte und mit der Installation der benötigten Pakete beginne, klappt gar nichts. Hier das Skript (das funktioniert) zur Info.
# Benötigte Pakete und Daten laden

  # Pakete für die Datenanalyse
  x <- c("reshape2", "ggplot2", "Hmisc")
 
  # Pakete für die Analyse räumlicher Objekte
  y <- c("sp", "rgdal", "tmap", "ncdf4", "rgeos", "ggrepel")
 
  # Pakete installieren - nur einmal erforderlich
  install.packages(x, dependencies = TRUE)
  install.packages(x, dependencies = TRUE)
 
  # Benötigte Pakete in R laden - bei jedem Start erforderlich
  lapply(x,  library,  character.only = TRUE)
  lapply(y,  library,  character.only = TRUE)
  rm(x, y)

Damit der Fehlerbericht nicht endloslang wird, installiere ich zur Demonstration nur ein Paket
> install.packages("sp", dependencies = TRUE)
Installing package into ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘xts’, ‘intervals’, ‘zoo’, ‘spacetime’, ‘FNN’, ‘rgdal’, ‘rgeos’, ‘gstat’, ‘maptools’, ‘deldir’

versuche URL 'https://cloud.r-project.org/src/contrib/xts_0.11-0.tar.gz'
Content type 'application/x-gzip' length 533600 bytes (521 KB)
==================================================
downloaded 521 KB

versuche URL 'https://cloud.r-project.org/src/contrib/intervals_0.15.1.tar.gz'
Content type 'application/x-gzip' length 393014 bytes (383 KB)
==================================================
downloaded 383 KB

versuche URL 'https://cloud.r-project.org/src/contrib/zoo_1.8-3.tar.gz'
Content type 'application/x-gzip' length 856176 bytes (836 KB)
==================================================
downloaded 836 KB

versuche URL 'https://cloud.r-project.org/src/contrib/spacetime_1.2-2.tar.gz'
Content type 'application/x-gzip' length 3001357 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

versuche URL 'https://cloud.r-project.org/src/contrib/FNN_1.1.2.1.tar.gz'
Content type 'application/x-gzip' length 78525 bytes (76 KB)
==================================================
downloaded 76 KB

versuche URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

versuche URL 'https://cloud.r-project.org/src/contrib/rgeos_0.3-28.tar.gz'
Content type 'application/x-gzip' length 252833 bytes (246 KB)
==================================================
downloaded 246 KB

versuche URL 'https://cloud.r-project.org/src/contrib/gstat_1.1-6.tar.gz'
Content type 'application/x-gzip' length 2835561 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

versuche URL 'https://cloud.r-project.org/src/contrib/maptools_0.9-3.tar.gz'
Content type 'application/x-gzip' length 1580274 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

versuche URL 'https://cloud.r-project.org/src/contrib/deldir_0.1-15.tar.gz'
Content type 'application/x-gzip' length 73895 bytes (72 KB)
==================================================
downloaded 72 KB

versuche URL 'https://cloud.r-project.org/src/contrib/sp_1.3-1.tar.gz'
Content type 'application/x-gzip' length 1133621 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

* installing *source* package ‘intervals’ ...
** Paket ‘intervals’ erfolgreich entpackt und MD5 Summen überprüft
** libs
g++  -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c Endpoint.cpp -o Endpoint.o
/bin/bash: g++: Befehl nicht gefunden
/usr/lib/R/etc/Makeconf:168: recipe for target 'Endpoint.o' failed
make: *** [Endpoint.o] Error 127
ERROR: compilation failed for package ‘intervals’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/intervals’
Warning in install.packages :
  installation of package ‘intervals’ had non-zero exit status
* installing *source* package ‘zoo’ ...
** Paket ‘zoo’ erfolgreich entpackt und MD5 Summen überprüft
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I../inst/include     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c coredata.c -o coredata.o
In file included from coredata.c:23:0:
/usr/share/R/include/R.h:55:11: fatal error: stdlib.h: Datei oder Verzeichnis nicht gefunden
 # include <stdlib.h> /* Not used by R itself, but widely assumed in packages */
           ^~~~~~~~~~
compilation terminated.
/usr/lib/R/etc/Makeconf:159: recipe for target 'coredata.o' failed
make: *** [coredata.o] Error 1
ERROR: compilation failed for package ‘zoo’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/zoo’
Warning in install.packages :
  installation of package ‘zoo’ had non-zero exit status
* installing *source* package ‘FNN’ ...
** Paket ‘FNN’ erfolgreich entpackt und MD5 Summen überprüft
** libs
g++  -I/usr/share/R/include -DNDEBUG -Iinclude -DUSING_R -DUSING_RPRINT     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c ANN.cpp -o ANN.o
/bin/bash: g++: Befehl nicht gefunden
/usr/lib/R/etc/Makeconf:168: recipe for target 'ANN.o' failed
make: *** [ANN.o] Error 127
ERROR: compilation failed for package ‘FNN’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/FNN’
Warning in install.packages :
  installation of package ‘FNN’ had non-zero exit status
* installing *source* package ‘deldir’ ...
** Paket ‘deldir’ erfolgreich entpackt und MD5 Summen überprüft
** libs
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c acchk.f -o acchk.o
/bin/bash: gfortran: Befehl nicht gefunden
/usr/lib/R/etc/Makeconf:182: recipe for target 'acchk.o' failed
make: *** [acchk.o] Error 127
ERROR: compilation failed for package ‘deldir’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/deldir’
Warning in install.packages :
  installation of package ‘deldir’ had non-zero exit status
* installing *source* package ‘sp’ ...
** Paket ‘sp’ erfolgreich entpackt und MD5 Summen überprüft
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c Rcentroid.c -o Rcentroid.o
In file included from sp.h:13:0,
                 from Rcentroid.c:28:
/usr/share/R/include/R.h:55:11: fatal error: stdlib.h: Datei oder Verzeichnis nicht gefunden
 # include <stdlib.h> /* Not used by R itself, but widely assumed in packages */
           ^~~~~~~~~~
compilation terminated.
/usr/lib/R/etc/Makeconf:159: recipe for target 'Rcentroid.o' failed
make: *** [Rcentroid.o] Error 1
ERROR: compilation failed for package ‘sp’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/sp’
Warning in install.packages :
  installation of package ‘sp’ had non-zero exit status
ERROR: dependency ‘zoo’ is not available for package ‘xts’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/xts’
Warning in install.packages :
  installation of package ‘xts’ had non-zero exit status
ERROR: dependency ‘sp’ is not available for package ‘rgdal’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status
ERROR: dependency ‘sp’ is not available for package ‘rgeos’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/rgeos’
Warning in install.packages :
  installation of package ‘rgeos’ had non-zero exit status
ERROR: dependency ‘sp’ is not available for package ‘maptools’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/maptools’
Warning in install.packages :
  installation of package ‘maptools’ had non-zero exit status
ERROR: dependencies ‘sp’, ‘zoo’, ‘xts’, ‘intervals’ are not available for package ‘spacetime’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/spacetime’
Warning in install.packages :
  installation of package ‘spacetime’ had non-zero exit status
ERROR: dependencies ‘sp’, ‘zoo’, ‘spacetime’, ‘FNN’ are not available for package ‘gstat’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/gstat’
Warning in install.packages :
  installation of package ‘gstat’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpIazSqe/downloaded_packages’

Ich habe von (https://stackoverflow.com/questions/20671814/non-zero-exit-status-r-3-0-1-xml-and-rcurl) den auf "had non-zero exit status" bezogenen Hinweis aufgegriffen und
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libxml2-dev
ausgeführt. Das half aber nicht.
Scheinbar funktioniert der C Compiler nicht.  Hier (https://stackoverflow.com/questions/26793359/cant-install-r-packages-on-linux-mint-17) werden Vorschläge zur Compilerinstallation gemacht - soll ich das machen?

Danke schonmal
edit: Ich habe g++ nachinstalliert
mp@Gert:~$ sudo apt-get install build-essential g++

Die Fehlermeldung ist jetzt zumindest kürzer
* installing *source* package ‘sp’ ...
** Paket ‘sp’ erfolgreich entpackt und MD5 Summen überprüft
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c Rcentroid.c -o Rcentroid.o
In file included from sp.h:13:0,
                 from Rcentroid.c:28:
/usr/share/R/include/R.h:55:11: fatal error: stdlib.h: Datei oder Verzeichnis nicht gefunden
 # include <stdlib.h> /* Not used by R itself, but widely assumed in packages */
           ^~~~~~~~~~
compilation terminated.
/usr/lib/R/etc/Makeconf:159: recipe for target 'Rcentroid.o' failed
make: *** [Rcentroid.o] Error 1
ERROR: compilation failed for package ‘sp’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/sp’
Warning in install.packages :
  installation of package ‘sp’ had non-zero exit status

The downloaded source packages are in
‘/tmp/Rtmpw9Cfsk/downloaded_packages’
« Letzte Änderung: 01.09.2018, 11:42:39 von Hufeisen »

Re: RStudio kann keine Pakete installieren
« Antwort #1 am: 31.08.2018, 14:28:45 »
Ich habe jetzt RStudio deinstalliert, um die Sache etwas einzugrenzen. Auf dem System ist noch R.
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

Ich versuche ein Paket zu installieren
> install.packages("sp", dependencies = TRUE)
Installiere Paket nach ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4’
(da ‘lib’ nicht spezifiziert)
installiere auch Abhängigkeiten ‘rgdal’, ‘rgeos’, ‘gstat’, ‘deldir’
Das lädt soweit alles runter, es beginnt die Installation. Diese scheitert recht schnell und das ist für alle Pakete so. Ich werde das ab hier weiter recherchieren.
* installing *source* package ‘deldir’ ...
** Paket ‘deldir’ erfolgreich entpackt und MD5 Summen überprüft
** libs
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c acchk.f -o acchk.o
/bin/bash: gfortran: Befehl nicht gefunden/usr/lib/R/etc/Makeconf:182: recipe for target 'acchk.o' failed
make: *** [acchk.o] Error 127
ERROR: compilation failed for package ‘deldir’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/deldir’

Hier wird eine Lösung vorgeschlagen (http://blogs.cuit.columbia.edu/ikr2107/binbash-gfortran-command-not-found/)
sudo apt-get install gfortran
sudo apt-get install r-base-dev

Augenscheinlich tut sich so etwas mehr. Den erfolgreichen download lasse ich wieder aus. Die Pakete deldir und sp werden - so scheint es - erfolgreich installiert.
> install.packages("sp", dependencies = TRUE)
Installiere Paket nach ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4’
(da ‘lib’ nicht spezifiziert)
installiere auch Abhängigkeiten ‘rgdal’, ‘rgeos’, ‘gstat’, ‘deldir’

* installing *source* package ‘deldir’ ...
** Paket ‘deldir’ erfolgreich entpackt und MD5 Summen überprüft
** libs
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c acchk.f -o acchk.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c addpt.f -o addpt.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c adjchk.f -o adjchk.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c binsrt.f -o binsrt.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c circen.f -o circen.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c cross.f -o cross.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c delet.f -o delet.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c delet1.f -o delet1.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c delout.f -o delout.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c delseg.f -o delseg.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c dirout.f -o dirout.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c dirseg.f -o dirseg.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c dldins.f -o dldins.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c initad.f -o initad.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c insrt.f -o insrt.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c insrt1.f -o insrt1.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c intri.f -o intri.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c locn.f -o locn.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c master.f -o master.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c mnnd.f -o mnnd.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c pred.f -o pred.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c qtest.f -o qtest.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c qtest1.f -o qtest1.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c stoke.f -o stoke.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c succ.f -o succ.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c swap.f -o swap.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c testeq.f -o testeq.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c triar.f -o triar.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c trifnd.f -o trifnd.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o deldir.so acchk.o addpt.o adjchk.o binsrt.o circen.o cross.o delet.o delet1.o delout.o delseg.o dirout.o dirseg.o dldins.o init.o initad.o insrt.o insrt1.o intri.o locn.o master.o mnnd.o pred.o qtest.o qtest1.o stoke.o succ.o swap.o testeq.o triar.o trifnd.o -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /home/mp/R/x86_64-pc-linux-gnu-library/3.4/deldir/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (deldir)


* installing *source* package ‘sp’ ...
** Paket ‘sp’ erfolgreich entpackt und MD5 Summen überprüft
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c Rcentroid.c -o Rcentroid.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c gcdist.c -o gcdist.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c pip.c -o pip.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c pip2.c -o pip2.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c sp_xports.c -o sp_xports.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c surfaceArea.c -o surfaceArea.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c zerodist.c -o zerodist.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o sp.so Rcentroid.o gcdist.o init.o pip.o pip2.o sp_xports.o surfaceArea.o zerodist.o -L/usr/lib/R/lib -lR
installing to /home/mp/R/x86_64-pc-linux-gnu-library/3.4/sp/libs
** R
** data
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (sp)

Für das Paket rgdal fehlt dann plötzlich die Konfiguration.
* installing *source* package ‘rgdal’ ...
** Paket ‘rgdal’ erfolgreich entpackt und MD5 Summen überprüft
configure: R_HOME: /usr/lib/R
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: C++11 support available
configure: rgdal: 1.3-4
checking for /usr/bin/svnversion... no
configure: svn revision: 766
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
Das ist für rgeos ganz genauso.
‘/tmp/RtmpawqK45/downloaded_packages’
Warnmeldungen:
1: In install.packages("sp", dependencies = TRUE) :
  Installation des Pakets ‘rgdal’ hatte Exit-Status ungleich 0
2: In install.packages("sp", dependencies = TRUE) :
  Installation des Pakets ‘rgeos’ hatte Exit-Status ungleich 0

Hier (https://stackoverflow.com/questions/12141422/error-gdal-config-not-found) wird folgendes vorgeschlagen (die Erklärung verstehe ich nicht genau):
sudo apt-get install libgdal1iDas Paket gibt es nicht
Paket libgdal1 ist nicht verfügbar, wird aber von einem anderen Paket
referenziert. Das kann heißen, dass das Paket fehlt, dass es abgelöst
wurde oder nur aus einer anderen Quelle verfügbar ist.

E: Für Paket »libgdal1« existiert kein Installationskandidat.
Im selben Thread wurde daher vorgeschlagen, das Paket, das die nötigen Befehle enthält, suchen zu lassen.
Zitat

You can use apt-file package, to find which package contains the missing file you are looking for.

First install the apt-file using the command apt-get install apt-file
Update apt-file using the command apt-file update
Now you can use apt-file to find the missing file. apt-file search gdal-config

For my case, I got the same error when configuring grass-7.1 from svn. As shown below:

    $ ./configure
    ...more...
    checking whether to use GDAL... yes
    checking for gdal-config... /usr/bin/gdal-config
                  ...more....
    ./configure: 1: ./configure: /usr/bin/gdal-config: not found
    ./configure: 6093: test: =: unexpected operator
    configure: error: *** Unable to locate GDAL library.

But, after looking for gdal-config file with apt-file as shown below, I was able to resolve the error, after installing the package libgdal1-dev

$ apt-file search gdal-config

Results

libgdal1-dev: /usr/bin/gdal-config

So I installed libgdal1-dev, as shown below:

$ sudo apt-get install libgdal1-dev



Also gesagt, getan.
mp@Gert:~$ apt-file search gdal-config
libgdal-dev: /usr/bin/gdal-config
libgdal-dev: /usr/share/man/man1/gdal-config.1.gz
libgdal-doc: /usr/share/doc/libgdal-doc/gdal/gdal-config.html
mp@Gert:~$ sudo apt-get install libgdal-dev

Danach ist man schonmal weiter. Das Paket wurde mit den Abhängigkeiten installiert.
checking gdal-config usability... yes[<
... ein paar Zeilen weiter...
** testing if installed package can be loaded
* DONE (rgdal)/code]
Als nächstes teste ich die übrigen Pakete.

Schon der nächste Versuch - tmap - hakt.
install.packages("tmap", dependencies = TRUE)
Installiere Paket nach ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4’
(da ‘lib’ nicht spezifiziert)
installiere auch Abhängigkeiten ‘ps’, ‘protolite’, ‘processx’, ‘gdtools’, ‘geojson’, ‘jqr’, ‘jsonvalidate’, ‘selectr’, ‘XML’, ‘satellite’, ‘webshot’, ‘stars’, ‘svglite’, ‘uuid’, ‘geojsonio’, ‘geojsonlint’, ‘V8’, ‘packcircles’, ‘lubridate’, ‘rvest’, ‘tmaptools’, ‘sf’, ‘units’, ‘raster’, ‘classInt’, ‘leaflet’, ‘mapview’, ‘lwgeom’, ‘rmapshaper’, ‘png’, ‘cartogram’, ‘osmdata’
... eine Menge Zeilen später ...
Es gab 21 Warnungen (Anzeige mit warnings())
> warnings()
Warnmeldungen:
1: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘protolite’ hatte Exit-Status ungleich 0
2: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘gdtools’ hatte Exit-Status ungleich 0
3: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘jqr’ hatte Exit-Status ungleich 0
4: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘V8’ hatte Exit-Status ungleich 0
5: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘units’ hatte Exit-Status ungleich 0
6: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘raster’ hatte Exit-Status ungleich 0
7: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘geojson’ hatte Exit-Status ungleich 0
8: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘jsonvalidate’ hatte Exit-Status ungleich 0
9: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘satellite’ hatte Exit-Status ungleich 0
10: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘svglite’ hatte Exit-Status ungleich 0
11: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘sf’ hatte Exit-Status ungleich 0
12: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘leaflet’ hatte Exit-Status ungleich 0
13: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘stars’ hatte Exit-Status ungleich 0
14: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘geojsonio’ hatte Exit-Status ungleich 0
15: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘geojsonlint’ hatte Exit-Status ungleich 0
16: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘lwgeom’ hatte Exit-Status ungleich 0
17: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘cartogram’ hatte Exit-Status ungleich 0
18: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘tmaptools’ hatte Exit-Status ungleich 0
19: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘mapview’ hatte Exit-Status ungleich 0
20: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘rmapshaper’ hatte Exit-Status ungleich 0
21: In install.packages("tmap", dependencies = TRUE) :
  Installation des Pakets ‘tmap’ hatte Exit-Status ungleich 0
« Letzte Änderung: 31.08.2018, 15:49:49 von Hufeisen »

Re: RStudio kann keine Pakete installieren
« Antwort #2 am: 31.08.2018, 16:20:15 »
21 Fehlermeldungen für tmap - das hält man ja nicht aus. Wenn es nicht an mir liegt, ist R schlichtweg unbenutzbar unter Linux. Ich werde R runterschmeißen und nach diesen guides nochmal installieren:
https://linuxconfig.org/install-r-on-ubuntu-18-04-bionic-beaver-linux
https://linuxconfig.org/rstudio-on-ubuntu-18-04-bionic-beaver-linux

Vermutlich liegen die Fehler daran, dass einige Pakete nicht in r-cran liegen, sondern von anderen Quellen installiert werden müssen (das klappt unter Windows einfach so). Das wird wohl hier erklärt:
https://linuxconfig.org/how-to-install-and-use-packages-in-gnu-r

Anmerkungen zur R-Installation (work in progress)
$ sudo apt -y install r-baseging nur ohne -y
« Letzte Änderung: 31.08.2018, 16:50:02 von Hufeisen »

Re: RStudio kann keine Pakete installieren
« Antwort #3 am: 31.08.2018, 18:32:44 »
Ich bin wieder etwas verwirrter. Nach dieser Anleitung (https://linuxconfig.org/how-to-install-and-use-packages-in-gnu-r) installiert man Pakete in R, die nicht in den Ubuntu-Repositories enthalten sind über einen externen Link, den man mit wget abruft und mit R CMD INSTALL die geladene Datei installiert.
wget - geht
mp@Gert:~$ wget https://cran.r-project.org/src/contrib/tmap_2.1-1.tar.gz
--2018-08-31 18:10:55--  https://cran.r-project.org/src/contrib/tmap_2.1-1.tar.gz
Auflösen des Hostnamens cran.r-project.org (cran.r-project.org) … 137.208.57.37
Verbindungsaufbau zu cran.r-project.org (cran.r-project.org)|137.208.57.37|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 3055403 (2,9M) [application/x-gzip]
Wird in »tmap_2.1-1.tar.gz« gespeichert.

tmap_2.1-1.tar.gz   100%[===================>]   2,91M  1,08MB/s    in 2,7s   

2018-08-31 18:10:58 (1,08 MB/s) - »tmap_2.1-1.tar.gz« gespeichert [3055403/3055403]
Installation geht nicht, weil Abhängigkeiten fehlen
R CMD INSTALL tmap_2.1-1.tar.gz
* installing to library ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4’
ERROR: dependencies ‘tmaptools’, ‘sf’, ‘units’, ‘raster’, ‘leaflet’, ‘mapview’ are not available for package ‘tmap’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/tmap’
Aus der Anleitung: NOTE: Be aware that some packages will require prerequisites. In that case use the above command to install prerequisites prior to your desired package.
Anbei: Unter Windows installiert R einfach das Paket inklusive der Abhängigkeiten.
Das kann doch nicht der Weg unter LInux sein ?!

Ich werde die Sache mal ins r-forum tragen.

Re: RStudio kann keine Pakete installieren
« Antwort #4 am: 31.08.2018, 18:52:57 »
Der Netznetiquette wegen: Ich habe mein Anliegen auch hier vorgetragen: http://forum.r-statistik.de/viewtopic.php?f=7&t=1057
Wenn auch das nichts bringt, was wäre denn der bessere Schritt, Wine oder eine Virtuelle Maschine?

Re: RStudio kann keine Pakete installieren
« Antwort #5 am: 31.08.2018, 21:55:07 »
Ich habe die aktuelle Version von RStudio geladen (1.1.456) - über das Terminal geht es inzwischen (mp@Gert:~$ sudo dpkg -i /home/mp/Downloads/rstudio-xenial-1.1.456-amd64.deb).
Ich habe rstudio jetzt das erste mal über das Terminal gestartet und das gibt gleich interessante Fehler aus.
mp@Gert:~$ rstudio
load glyph failed err=6 face=0x2904320, glyph=2798
load glyph failed err=6 face=0x2904320, glyph=2798
libpng warning: iCCP: known incorrect sRGB profile
^C
mp@Gert:~$ rstudio
load glyph failed err=6 face=0x1c36290, glyph=2798
load glyph failed err=6 face=0x1c36290, glyph=2798

Auch in RStudio gibt die Installation von ggplot2 Fehler aus
> install.packages("ggplot2", dependencies = TRUE)
Installing package into ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘gdtools’, ‘units’, ‘vdiffr’, ‘sf’, ‘svglite’

versuche URL 'https://cloud.r-project.org/src/contrib/gdtools_0.1.7.tar.gz'
Content type 'application/x-gzip' length 35268 bytes (34 KB)
==================================================
downloaded 34 KB

versuche URL 'https://cloud.r-project.org/src/contrib/units_0.6-0.tar.gz'
Content type 'application/x-gzip' length 912393 bytes (891 KB)
==================================================
downloaded 891 KB

versuche URL 'https://cloud.r-project.org/src/contrib/vdiffr_0.2.3.tar.gz'
Content type 'application/x-gzip' length 77057 bytes (75 KB)
==================================================
downloaded 75 KB

versuche URL 'https://cloud.r-project.org/src/contrib/sf_0.6-3.tar.gz'
Content type 'application/x-gzip' length 7973054 bytes (7.6 MB)
==================================================
downloaded 7.6 MB

versuche URL 'https://cloud.r-project.org/src/contrib/svglite_1.2.1.tar.gz'
Content type 'application/x-gzip' length 41315 bytes (40 KB)
==================================================
downloaded 40 KB

versuche URL 'https://cloud.r-project.org/src/contrib/ggplot2_3.0.0.tar.gz'
Content type 'application/x-gzip' length 2847050 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

* installing *source* package ‘gdtools’ ...
** Paket ‘gdtools’ erfolgreich entpackt und MD5 Summen überprüft
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcairo
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because cairo was not found. Try installing:
 * deb: libcairo2-dev (Debian, Ubuntu)
 * rpm: cairo-devel (Fedora, CentOS, RHEL)
 * csw: libcairo_dev (Solaris)
 * brew: cairo (OSX)
If cairo is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a cairo.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘gdtools’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/gdtools’
Warning in install.packages :
  installation of package ‘gdtools’ had non-zero exit status
* installing *source* package ‘units’ ...
** Paket ‘units’ erfolgreich entpackt und MD5 Summen überprüft
configure: units: 0.6-0
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for error_at_line... yes
checking for gcc... gcc -std=gnu99
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... no
configure: error: in `/tmp/RtmpLlcCyc/R.INSTALLc5d53bea1f1/units':
configure: error:
--------------------------------------------------------------------------------
  libudunits2.so not found!

  If the udunits2 library is installed in a non-standard location, use:

    --configure-args='--with-udunits2-lib=/usr/local/lib'

  for example, if the library was not found, and/or

    --configure-args='--with-udunits2-include=/usr/include/udunits2'

  if the header was not found, replacing paths with appropriate values for your
  installation. You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIBS
  environment variables.

  If udunits2 is not installed, please install it.
  It is required for this package.
--------------------------------------------------------------------------------

See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/units’
Warning in install.packages :
  installation of package ‘units’ had non-zero exit status
* installing *source* package ‘ggplot2’ ...
** Paket ‘ggplot2’ erfolgreich entpackt und MD5 Summen überprüft
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (ggplot2)
ERROR: dependency ‘units’ is not available for package ‘sf’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/sf’
Warning in install.packages :
  installation of package ‘sf’ had non-zero exit status
ERROR: dependency ‘gdtools’ is not available for package ‘svglite’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/svglite’
Warning in install.packages :
  installation of package ‘svglite’ had non-zero exit status
ERROR: dependencies ‘gdtools’, ‘svglite’ are not available for package ‘vdiffr’
* removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/vdiffr’
Warning in install.packages :
  installation of package ‘vdiffr’ had non-zero exit status

The downloaded source packages are in
‘/tmp/Rtmp9EluCm/downloaded_packages’

Kann jemand etwas mit den Terminalfehlern anfangen?

Re: RStudio kann keine Pakete installieren
« Antwort #6 am: 01.09.2018, 11:42:26 »
Ich habe das Problem nun gelöst. Man ist das eine Frickelei. Von R kann man unter Linux nur abraten, weil ständig irgendwelche Pakete fehlen, die R aber nicht selbst installieren kann, weil es Linuxpakete sind. Also muss man die Fehlerberichte studieren - in der Regel sagt R, was fehlt, manchmal muss man googeln - und dann sudo installiere das Paket (und auch von Linux - sudo installiere Befehl aus dem Internet ist ja gerade nicht Sinn administrierter Paketquellen). Der Gedanke von R wird dadurch ad absurdum geführt. R ist, wer es nicht weiß, eine Programmiersprache für Statistikprobleme. Man arbeitet mit Code statt Klickmenüs. Das ist zwar weniger einfach, dafür hat der Code verschiedene Vorteile:
Er ist in Sekunden reproduzierbar - sende eine E-Mail an deinen Freund, der kopiert den Code, fügt ihn in R ein und führt ihn aus.
Damit hat der Code auch eine kommunikative Seite und Stärke. Statt "geht nicht, ich habe hier und da geklickt, oder so" kann man die Arbeitsschritte nachvollziehen.
Letzteres fällt aber aus, wenn man sagen muss: Der Code läuft, allerdings gibt es distributionsspezifische Abhängigkeiten, die sie selbst auflösen müssen. Viel Glück.

Das mal nur so - da hat sich in den letzten Tagen viel Frust aufgebaut. Nun denn, achievement unlocked. :D

Der Arbeitsverlauf ist hier dokumentiert http://forum.r-statistik.de/viewtopic.php?f=7&t=1057 . Ob die Dokumentation vollständig ist, kann ich nicht sagen, da ich auf dem Weg dutzende Pakete installiert habe, weil das bei irgendwem so funktioniert hatte. Ich zitiere mich mal aus dem anderen Forum selbst.

Zitat von: Hufeisen post_id=5008 time=1535788980 user_id=796
Die Lösung? Ich denke, ich habe es jetzt.

Das Problem mit tmap: Die Liste der Abhängigkeiten für das tmap-Paket ist offensichtlich nicht vollständig. Das Paket setzt auf anderen Paketen auf, die wiederum auf sf aufsetzen. sf ist wohl unter starker Entwicklung, denn die Versionsnummer ist aktuell sf_0.6.3. Man muss die Sache also nun von hinten aufdröseln und sf installieren. Das hat bei mir (natürlich nicht geklappt).
mp@Gert:~$ wget https://cran.r-project.org/src/contrib/sf_0.6-3.tar.gz
--2018-09-01 09:48:21--  https://cran.r-project.org/src/contrib/sf_0.6-3.tar.gz
Auflösen des Hostnamens cran.r-project.org (cran.r-project.org) … 137.208.57.37
Verbindungsaufbau zu cran.r-project.org (cran.r-project.org)|137.208.57.37|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 7973054 (7,6M) [application/x-gzip]
Wird in »sf_0.6-3.tar.gz« gespeichert.

sf_0.6-3.tar.gz     100%[===================>]   7,60M   494KB/s    in 14s     

2018-09-01 09:48:35 (550 KB/s) - »sf_0.6-3.tar.gz« gespeichert [7973054/7973054]

mp@Gert:~$ sudo  R CMD INSTALL sf_0.6-3.tar.gz
* installing to library ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4’
ERROR: failed to lock directory ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4’ for modifying
Try removing ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4/00LOCK-sf’
Wie man am Ende sieht ist ein LOCK auf /home/mp/R/x86_64-pc-linux-gnu-library/3.4/00LOCK-sf . Wie, warum - keine Ahnung. Ich navigiere mit dem Fenstermanager (nemo) in das Verzeichnis und lösche den leeren Ordner /home/mp/R/x86_64-pc-linux-gnu-library/3.4/00LOCK-sf . Danach ließ sich sf installieren
mp@Gert:~$ sudo  R CMD INSTALL sf_0.6-3.tar.gz
* installing to library ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4’
* installing *source* package ‘sf’ ...
** Paket ‘sf’ erfolgreich entpackt und MD5 Summen überprüft
configure: CC: gcc -std=gnu99
configure: CXX: g++
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.2.3
checking GDAL version >= 2.0.0... yes
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/share/gdal/2.2/pcs.csv readable... yes
checking GDAL: checking whether PROJ.4 is available for linking:... yes
checking GDAL: checking whether PROJ.4 is available fur running:... yes
configure: pkg-config proj exists, will use it
checking proj_api.h usability... yes
checking proj_api.h presence... yes
checking for proj_api.h... yes
configure: PROJ: 4.9.3
checking for pj_init_plus in -lproj... yes
checking PROJ.4: epsg found and readable... yes
checking PROJ.4: conus found and readable... yes
checking for geos-config... /usr/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.6.2
checking GEOS version >= 3.4.0... yes
checking geos_c.h usability... yes
checking geos_c.h presence... yes
checking for geos_c.h... yes
checking geos: linking with -L/usr/lib/x86_64-linux-gnu -lgeos_c... yes
configure: Package CPP flags:   -I/usr/include/gdal -I/usr/include
configure: Package LIBS: -lproj   -L/usr/lib -lgdal -L/usr/lib/x86_64-linux-gnu -lgeos_c
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c bbox.cpp -o bbox.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal.cpp -o gdal.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_geom.cpp -o gdal_geom.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_read.cpp -o gdal_read.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_utils.cpp -o gdal_utils.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_write.cpp -o gdal_write.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c geos.cpp -o geos.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c hex.cpp -o hex.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c proj.cpp -o proj.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c raster2sf.cpp -o raster2sf.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c sfg.cpp -o sfg.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c signed_area.cpp -o signed_area.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c stars.cpp -o stars.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c wkb.cpp -o wkb.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o sf.so RcppExports.o bbox.o gdal.o gdal_geom.o gdal_read.o gdal_utils.o gdal_write.o geos.o hex.o proj.o raster2sf.o sfg.o signed_area.o stars.o wkb.o -lproj -L/usr/lib -lgdal -L/usr/lib/x86_64-linux-gnu -lgeos_c -L/usr/lib/R/lib -lR
installing to /home/mp/R/x86_64-pc-linux-gnu-library/3.4/sf/libs
** R
** data
** demo
** inst
** preparing package for lazy loading
in method for ‘dbWriteTable’ with signature ‘"PostgreSQLConnection","character","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘dbDataType’ with signature ‘"PostgreSQLConnection","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘coerce’ with signature ‘"Spatial","sf"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"Spatial","sfc"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sf","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sfc","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"XY","Spatial"’: no definition for class “Spatial”
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (sf)

Danach ließ sich auch in R sf laden (library(sf)) und tmap installieren.
install.packages("tmap")
Installiere Paket nach ‘/home/mp/R/x86_64-pc-linux-gnu-library/3.4’
(da ‘lib’ nicht spezifiziert)
installiere auch Abhängigkeiten ‘lwgeom’, ‘stars’, ‘tmaptools’, ‘mapview’

versuche URL 'https://cloud.r-project.org/src/contrib/lwgeom_0.1-4.tar.gz'
Content type 'application/x-gzip' length 432706 bytes (422 KB)
==================================================
downloaded 422 KB

versuche URL 'https://cloud.r-project.org/src/contrib/stars_0.1-1.tar.gz'
Content type 'application/x-gzip' length 4064586 bytes (3.9 MB)
==================================================
downloaded 3.9 MB

versuche URL 'https://cloud.r-project.org/src/contrib/tmaptools_2.0-1.tar.gz'
Content type 'application/x-gzip' length 84292 bytes (82 KB)
==================================================
downloaded 82 KB

versuche URL 'https://cloud.r-project.org/src/contrib/mapview_2.5.0.tar.gz'
Content type 'application/x-gzip' length 2012996 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

versuche URL 'https://cloud.r-project.org/src/contrib/tmap_2.1-1.tar.gz'
Content type 'application/x-gzip' length 3055403 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

* installing *source* package ‘lwgeom’ ...
** Paket ‘lwgeom’ erfolgreich entpackt und MD5 Summen überprüft
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: pkg-config proj exists, will use it
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking proj_api.h usability... yes
checking proj_api.h presence... yes
checking for proj_api.h... yes
configure: PROJ: 4.9.3
checking for pj_init_plus in -lproj... yes
checking PROJ.4: epsg found and readable... yes
checking PROJ.4: conus found and readable... yes
checking for geos-config... /usr/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.6.2
checking GEOS version >= 3.3.0... yes
checking geos_c.h usability... yes
checking geos_c.h presence... yes
checking for geos_c.h... yes
checking geos: linking with -L/usr/lib/x86_64-linux-gnu -lgeos_c... yes
checking for lwgeom_make_valid in -llwgeom... yes
checking for lwgeom_grid_in_place in -llwgeom... no
checking liblwgeom_internal.h usability... no
checking liblwgeom_internal.h presence... no
checking for liblwgeom_internal.h... no
configure: Package CPP flags:  -DPOSTGIS_GEOS_VERSION=35 -DHAVE_LIBGEOM -DNO_GRID_IN_PLACE
configure: Package LIBS:  -llwgeom
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -DPOSTGIS_GEOS_VERSION=35 -DHAVE_LIBGEOM -DNO_GRID_IN_PLACE -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/sf/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c geodetic.cpp -o geodetic.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -DPOSTGIS_GEOS_VERSION=35 -DHAVE_LIBGEOM -DNO_GRID_IN_PLACE -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/sf/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c lwgeom.cpp -o lwgeom.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -DPOSTGIS_GEOS_VERSION=35 -DHAVE_LIBGEOM -DNO_GRID_IN_PLACE -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/sf/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -DPOSTGIS_GEOS_VERSION=35 -DHAVE_LIBGEOM -DNO_GRID_IN_PLACE -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/sf/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c proj.cpp -o proj.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -DPOSTGIS_GEOS_VERSION=35 -DHAVE_LIBGEOM -DNO_GRID_IN_PLACE -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/sf/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c geos.cpp -o geos.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -DPOSTGIS_GEOS_VERSION=35 -DHAVE_LIBGEOM -DNO_GRID_IN_PLACE -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/sf/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c io.cpp -o io.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o lwgeom.so geodetic.o lwgeom.o RcppExports.o proj.o geos.o io.o -llwgeom -L/usr/lib/R/lib -lR
installing to /home/mp/R/x86_64-pc-linux-gnu-library/3.4/lwgeom/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (lwgeom)
* installing *source* package ‘stars’ ...
** Paket ‘stars’ erfolgreich entpackt und MD5 Summen überprüft
** R
** demo
** inst
** preparing package for lazy loading
in method for ‘coerce’ with signature ‘"stars","Raster"’: no definition for class “Raster”
in method for ‘coerce’ with signature ‘"stars","STFDF"’: no definition for class “STFDF”
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (stars)
* installing *source* package ‘tmaptools’ ...
** Paket ‘tmaptools’ erfolgreich entpackt und MD5 Summen überprüft
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (tmaptools)
* installing *source* package ‘mapview’ ...
** Paket ‘mapview’ erfolgreich entpackt und MD5 Summen überprüft
** libs
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c brewCppFun.cpp -o brewCppFun.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/mp/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c mapviewCppFun.cpp -o mapviewCppFun.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o mapview.so RcppExports.o brewCppFun.o mapviewCppFun.o -L/usr/lib/R/lib -lR
installing to /home/mp/R/x86_64-pc-linux-gnu-library/3.4/mapview/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
in method for ‘mapView’ with signature ‘x="stars"’: no definition for class “stars”
in method for ‘viewRGB’ with signature ‘x="stars"’: no definition for class “stars”
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (mapview)
* installing *source* package ‘tmap’ ...
** Paket ‘tmap’ erfolgreich entpackt und MD5 Summen überprüft
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (tmap)

Ich werde jetzt in RStudio probieren, ob mein Skript regulär durchläuft. Mein Skript
# Benötigte Pakete und Daten laden

  # Pakete für die Datenanalyse
  x <- c("reshape2", "ggplot2", "Hmisc")
 
  # Pakete für die Analyse räumlicher Objekte
  y <- c("sp", "rgdal", "tmap", "ncdf4", "rgeos", "ggrepel")
 
  # Pakete installieren - nur einmal erforderlich
  install.packages(x, dependencies = TRUE)
  install.packages(y, dependencies = TRUE)
 
  # Benötigte Pakete in R laden - bei jedem Start erforderlich
  lapply(x,  library,  character.only = TRUE)
  lapply(y,  library,  character.only = TRUE)
  rm(x, y)

Das läuft jetzt in RStudio ohne Fehler durch - soweit ich das sehen kann, denn die Anzahl der ausgeführten Schritte überschreiten die im Terminal behaltenen Zeilen.

Inzwischen läuft es ;).