From 3a30cd27fc555a0f1b37e64dc5fd4449f00874c9 Mon Sep 17 00:00:00 2001
From: Stefan Kranz <kranz.stefan99@gmail.com>
Date: Thu, 16 Jan 2020 11:26:32 +0100
Subject: [PATCH] install only required

---
 DEM2POINT.R | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/DEM2POINT.R b/DEM2POINT.R
index 041a514..b277e93 100644
--- a/DEM2POINT.R
+++ b/DEM2POINT.R
@@ -1,19 +1,9 @@
 ## Install of additional packages
 ## pkgs are will only be downloaded, if they aren't installed yet
-
-# pacman is currently only available for R 3.5 and higher, which isn't available for Linux LTS distros
-#if(!require(pacman)) {
-#        install.packages("pacman")
-#        library(pacman)
-#}
-
 pkgNeeded <- c("base", "raster", "maptools", "sp", "dismo", "rasterVis", "rgdal")
 isInstalled <- sapply(pkgNeeded, require, character.only = TRUE)
 print(isInstalled)
-
-
-pacman::p_load("raster", "maptools", "sp", "dismo", "rasterVis", "rgdal") 
-# notice: when '#' the line is "neutral = Not run"
+install.packages(pkgNeeded[!isInstalled], quiet = FALSE)
 
 # set path to DEM-raster
 rasterpath<-"C:/Users/CHORO_04/Onedrive/PRACTICALS/AREALKUNDE/SDM"
-- 
GitLab