%     This is the LaTeX source file for the Pre-Course Handout for the 
%     git@github.com:brfitzpatrick/Intro_to_R 
%     Short Course
%     Copyright (C) 2015  Ben R. Fitzpatrick.
%
%    This program is free software: you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    This program is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with this program.  If not, see <http://www.gnu.org/licenses/>.
%
%    The course author may be contacted by email at 
%    <ben.r.fitzpatrick@gmail.com>

\documentclass{article}[12pt]
\usepackage{multirow}
\usepackage{hyperref}
\usepackage{textcomp}
\usepackage{upquote}

\begin{document}

\title{\huge Introduction to R \\
 \large Pre-Course Handout}


\author{Ben R. Fitzpatrick\\ 
\small PhD Candidate, Mathematical Sciences School,\\
\small Queensland University of Technology, Brisbane, QLD.}
\date{\today}
\maketitle

\section*{Prior to Course}
Please do you best to install the software listed below on the laptop you will bring to the course.
Please also ensure you have `Eduroam' \url{http://www.eduroam.edu.au/} configured on your laptop so that you can access the internet during the course.  
Internet access on the laptop you are using will be vital to completing the module on version control with Git and GitHub.
If possible please bring along some data that interests you, for use in exercises.
Please note: I would like you to be able to show the results of your exercises on these data to other students during the course so if you have data that you are not allowed to let other people see please don't bring these data.
If you don't have any data you'd like work on there is plenty of free data available online that will suit our purposes - I can show you where you can download some such data during the course.
\newline
\newline
\textbf{Prior to the course please}: \begin{itemize}
\item download and install \textbf{R}
\item download and install \textbf{RStudio}
\item download and install the \textbf{R packages: `ggplot2', `rgl', `DAAG', `rgdal'} and \textbf{`raster'}
\item download and install \textbf{Git}
\item if you'd rather not use \textbf{Notepad} or the TextEdit you might like to download and install one of \textbf{Atom, Sublime, TextMate} or \textbf{Emacs}
\item create a GitHub account. \end{itemize}

\textbf{Note:} Please ensure that all the listed software are installed to the hard drive of the laptop you will bring to the course (rather than to your personal folder on your university's network shared drives as this will likely not be accessible when you are away from your university).

\subsection*{Downloading and Installing R}
R is available for free download for Windows, MacOS, and GNU+Linux from the Comprehensive R Archive Network here: \url{http://cran.r-project.org/}.  At the time of writing the current release was R version 3.2.1.

\subsection*{Downloading and Installing RStudio}
RStudio is available to download from here: \url{http://www.rstudio.com/}.
Please download the free, open source, desktop edition.
There is a good, short, video introducing RStudio here \url{http://www.rstudio.com/products/rstudio/} if you are curious.

\subsection*{Downloading and Installing R Packages}
Prior to the course please install the R packages: \begin{itemize}
 \item `ggplot2'
 \item `rgl'
 \item `DAAG'
 \item `rgdal'
 \item `raster'
\end{itemize}

To install R packages with the RStudio R package manager please: \begin{enumerate}
\item ensure your computer is connected to the internet and logged in such that you can access the broader internet (not just your university's intranet e.g. make sure you can visit \url{www.abc.net.au})
\item open RStudio
\item from the `Tools' menu up the top selected `Install Packages'
\item Type the names of the packages you want to install into the dialogue box separated by commas
\item Click `Install'
\end{enumerate}
You will need to select a mirror from which to download the packages; Canberra or Melbourne are good choices if you are in Australia.
Please check that you have successfully installed each of these packages by loading them with the library command e.g. to load the `ggplot2' package use:
\begin{verbatim}
library('ggplot2')
\end{verbatim}

\subsection*{Downloading and Installing Git}
\textbf{MS Windows} \& \textbf{Mac OS X} users please visit \url{http://git-scm.com/downloads} and follow the instructions there.
\newline
\newline
\textbf{MS Windows users:} Please make sure you check the box during the installation process to allow Git execution at the Windows Command Prompt.
\newline
\newline
\textbf{GNU+Linux} users:\\
Debian/Ubuntu: \begin{verbatim} sudo apt-get install git-core \end{verbatim} 
Fedora/RedHat: \begin{verbatim} sudo yum install git-core \end{verbatim}

Please also download and install the current version of \textbf{Meld} for your operating system: \url{http://meldmerge.org/}

\subsection*{Downloading a Text Editor of Your Choice}
By default \textbf{Git} will open the \textbf{Vim} text editor when the time comes for you to write a commit message.
Vim is a little difficult to get into at first, running in the terminal as it does with separate insert and command modes.
If you would prefer you can set either Notepad (Windows) or TextEdit (MacOS) as the default text editor Git will open when you need to write commit messages.  
You may also configure Git to use one of several popular editors such as \textbf{Atom, Sublime, TextMate} or Emacs.
If you already know how to use one of these editors this will likely be easiest.  
Atom, Sublime and Emacs (Speaks Statistics) can all be used as IDEs for R, if you already know one this may be a good option too.
\newline
\newline
To install Atom, Sublime or TextMate see these links: \begin{itemize}
\item Atom: \url{https://atom.io/docs/v1.0.0/getting-started-installing-atom}
\item Sublime: \url{http://www.sublimetext.com/2}
\item TextMate: \url{http://macromates.com/download}
\end{itemize}

\textbf{GNU+Linux users:} Emacs, Nano or Vim will suffice as a text editor to write Git commit messages here provided you know how to use one of them.
Debian/Ubuntu: \begin{itemize}
\item \begin{verbatim} sudo apt-get install emacs \end{verbatim} 
\item \begin{verbatim} sudo apt-get install nano \end{verbatim} 
\item \begin{verbatim} sudo apt-get install vim \end{verbatim} 
\end{itemize}

Debian/Ubuntu: \begin{itemize}
\item \begin{verbatim} sudo yum install emacs \end{verbatim} 
\item \begin{verbatim} sudo yum install nano \end{verbatim} 
\item \begin{verbatim} sudo yum install vim \end{verbatim} 
\end{itemize}

\subsection*{Creating a GitHub Account}
Navigate to \url{https://github.com/} and click the green `Sign Up' button in the top right.\\
Complete the sign up process.
\newline
\newline
\textbf{Note}: with a .edu email address you qualify for 5 private repositories (for now think folders to put things in) for free.\\
Please visit \url{https://education.github.com/discount_requests/new} to request your 5 free private repositories.

\section*{Optional Pre-reading}
\subsection*{Concerning R and its growing popularity}
If you'd like to find out a bit more about R and its increasing popularity I heartily refer you to the following pieces: \begin{itemize}
\item \url{http://www.revolutionanalytics.com/r-is-still-hot}
\item \href{http://www.wired.com/2015/01/microsoft-acquires-open-source-data-science-company-revolution-analytics}{http://www.wired.com/2015/01/microsoft-acquires-open-source-data-science-company-revolution-analytics}
\end{itemize}

\subsection*{Concerning the RStudio IDE for R}
If you'd like a little preview of the Integrated Development Environment we will be using to author R code and interact with the R program I refer you to the following sources on RStudio and its intuitive yet feature rich approach to authoring R code and running an R program: \begin{itemize}
\item \url{https://vimeo.com/97166163}
\item \url{http://www.rstudio.com/products/rstudio/features/}
\newline
\newline
\end{itemize}
Thank you for taking the time to prepare for the course, I look forward to meeting you all in Adelaide and empowering you all to utilize the wonderful, free and open source tool that is R.
\newline
\newline
\newline
    - \textit{Ben R. Fitzpatrick, \date{\today}}

\end{document}
