Switch branches/tags
Nothing to show
Find file
602a980 Sep 23, 2012
@johnmyleswhite @drewconway
50 lines (39 sloc) 1.69 KB
# File-Name: package_installer.R
# Date: 2012-02-10
# Author: Drew Conway (
# Purpose: Install all of the packages needed for the Machine Learning for Hackers case studies
# Data Used: n/a
# Packages Used: n/a
# All source code is copyright (c) 2012, under the Simplified BSD License.
# For more information on FreeBSD see:
# All images and materials produced by this code are licensed under the Creative Commons
# Attribution-Share Alike 3.0 United States License:
# All rights reserved.
# Create a vector containing all of the packages that will be used in the case studies
# (in no particular order)
cran.packages <- c("e1071",
cat("This script will now attempt to install all of the R packages used in 'Machine Learning for Hackers'")
for(p in cran.packages) {
if(!suppressWarnings(require(p, character.only = TRUE, quietly = TRUE))) {
cat(paste(p, "missing, will attempt to install\n"))
install.packages(p, dependencies = TRUE, type = "source")
else {
cat(paste(p, "installed OK\n"))
print("### All required packages installed ###")