This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Copyright 2020 Alexander Yakushev | |
% | |
% This work may be distributed and/or modified under the | |
% conditions of the LaTeX Project Public License, either version 1.3 | |
% of this license or (at your option) any later version. | |
% The latest version of this license is in | |
% http://www.latex-project.org/lppl.txt | |
% and version 1.3 or later is part of all distributions of LaTeX | |
% version 2005/12/01 or later. | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ipak function: install and load multiple R packages. | |
# check to see if packages are installed. Install them if they are not, then load them into the R session. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} |