From 46799e61dc540b6f9da6768b55e380179ee376e5 Mon Sep 17 00:00:00 2001 From: test2 Date: Wed, 11 Mar 2020 23:44:09 +0200 Subject: [PATCH] readme --- README.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8fda3a7..98a3c72 100644 --- a/README.md +++ b/README.md @@ -25,18 +25,17 @@ This is a quickstart guide of howto use this *LabInstance* Here is a simple code to reinstall all the necessary R packages to keep you up and running. The script will check whether the required packages have been installed, if not, it will install them accordingly. ---- -#create a function to check for installed packages and install them if they are not installed -install <- function(packages){ - new.packages <- packages[!(packages %in% installed.packages()[, "Package"])] - if (length(new.packages)) - install.packages(new.packages, dependencies = TRUE) - sapply(packages, require, character.only = TRUE) -} - -required.packages <- c("package1", "package2" ) -install(required.packages) ---- + +> #create a function to check for installed packages and install them if they are not installed +> install <- function(packages){ +> new.packages <- packages[!(packages %in% installed.packages()[, "Package"])] +> if (length(new.packages)) +> install.packages(new.packages, dependencies = TRUE) +> sapply(packages, require, character.only = TRUE) +> } +> +> required.packages <- c("package1", "package2" ) +> install(required.packages) ---