From e34f2933c58e412c94f029265e79fe6d97494bc7 Mon Sep 17 00:00:00 2001 From: test2 Date: Wed, 11 Mar 2020 23:50:28 +0200 Subject: [PATCH] readme --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b60b541..aafbe7f 100644 --- a/README.md +++ b/README.md @@ -24,18 +24,25 @@ This is a quickstart guide of howto use this *LabInstance* > root -## install R packages +- install R packages Here is a simple code to install 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. > 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)