{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Installing Graphics Packages" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Warning message:\n", ": dependency ‘graph’ is not available" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "The downloaded binary packages are in\n", "\t/var/folders/xf/rzdg30ps11g93j3w0h589q780000gn/T//Rtmp6KHSAJ/downloaded_packages\n" ] }, { "data": { "text/html": [ "
\n", "\t
ggplot2
\n", "\t\t
TRUE
\n", "\t
gplots
\n", "\t\t
TRUE
\n", "\t
lattice
\n", "\t\t
TRUE
\n", "\t
plyr
\n", "\t\t
TRUE
\n", "\t
reshape2
\n", "\t\t
TRUE
\n", "\t
RColorBrewer
\n", "\t\t
TRUE
\n", "\t
grid
\n", "\t\t
TRUE
\n", "\t
gridExtra
\n", "\t\t
TRUE
\n", "\t
igraph
\n", "\t\t
TRUE
\n", "\t
igraphdata
\n", "\t\t
TRUE
\n", "
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[ggplot2] TRUE\n", "\\item[gplots] TRUE\n", "\\item[lattice] TRUE\n", "\\item[plyr] TRUE\n", "\\item[reshape2] TRUE\n", "\\item[RColorBrewer] TRUE\n", "\\item[grid] TRUE\n", "\\item[gridExtra] TRUE\n", "\\item[igraph] TRUE\n", "\\item[igraphdata] TRUE\n", "\\end{description*}\n" ], "text/markdown": [ "ggplot2\n", ": TRUEgplots\n", ": TRUElattice\n", ": TRUEplyr\n", ": TRUEreshape2\n", ": TRUERColorBrewer\n", ": TRUEgrid\n", ": TRUEgridExtra\n", ": TRUEigraph\n", ": TRUEigraphdata\n", ": TRUE\n", "\n" ], "text/plain": [ " ggplot2 gplots lattice plyr reshape2 RColorBrewer \n", " TRUE TRUE TRUE TRUE TRUE TRUE \n", " grid gridExtra igraph igraphdata \n", " TRUE TRUE TRUE TRUE " ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# from https://gist.github.com/stevenworthington/3178163\n", "ipak <- function(pkg){\n", " new.pkg <- pkg[!(pkg %in% installed.packages()[, \"Package\"])]\n", " if (length(new.pkg)) \n", " install.packages(new.pkg, dependencies = TRUE, repos = \"http://cran.r-project.org\")\n", " sapply(pkg, require, character.only = TRUE)\n", "}\n", " \n", "# usage\n", "packages <- c(\"ggplot2\", \"gplots\", \"lattice\", \"plyr\", \"reshape2\",\n", " \"RColorBrewer\", \"grid\", \"gridExtra\", \"igraph\", \"igraphdata\")\n", "suppressMessages(ipak(packages))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "R", "language": "R", "name": "ir" }, "language_info": { "codemirror_mode": "r", "file_extension": ".r", "mimetype": "text/x-r-source", "name": "R", "pygments_lexer": "r", "version": "3.2.3" } }, "nbformat": 4, "nbformat_minor": 0 }