\documentclass{beamer}
%\documentclass[handout]{beamer} aurait supprimé les ``overlays''

\usepackage{fancyvrb}
\usepackage{amsmath,amssymb}
\definecolor{midnightblue}{rgb}{0.098,0.098,0.439}

\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl,formatcom={\color{violet}}}
\DefineVerbatimEnvironment{Soutput}{Verbatim}{,formatcom={\color{midnightblue}}}
\DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl,formatcom={\color{violet}}}
\newenvironment{Schunk}{}{}
\DefineVerbatimEnvironment{Code}{Verbatim}{,formatcom={\color{violet}}}
\DefineVerbatimEnvironment{CodeInput}{Verbatim}{fontshape=sl,formatcom={\color{violet}}}
\DefineVerbatimEnvironment{CodeOutput}{Verbatim}{,formatcom={\color{midnightblue}}}
\newenvironment{CodeChunk}{}{}

\newcommand{\vide}[1]{}
\newtheorem{proposition}{Proposition}
\newcommand{\prob}{\text{\fontfamily{cmss}\fontseries{sbc}\fontshape{n}\selectfont P}}
\newcommand{\Prob}{\text{\fontfamily{cmss}\fontseries{sbc}\fontshape{n}\selectfont P}}
%\newcommand{\transp}{^{\text{\fontfamily{cmss}\fontseries{sbc}\fontshape{n}\selectfont T}}}
\newcommand{\transp}{^{\text{\fontfamily{cmss}\fontseries{m}\fontshape{n}\selectfont T}}}
\newcommand{\Log}{\rm Log}
\newcommand{\Argmax}{\rm Argmax}
\newcommand{\Var}{\mathrm{Var}}
\newcommand{\var}{\mathrm{var}}
\newcommand{\Cov}{\mathrm{Cov}}
\newcommand{\cov}{\mathrm{cov}}
\def\ind {\mbox {\rm 1\!\!\,l}}%fonction indicatrice

% \usepackage{pdfanim}
% \input{pdfanim-patch}
% \PDFAnimLoad[loop,remember,startframe=1,scaletype=A,height=100pt,width=150pt]{cloud}{balls}{10}

\usetheme{Warsaw}% le thème choisi pour ma présentation
\useoutertheme[hooks]{tree}
%\usecolortheme{seahorse}



\DeclareGraphicsRule{.pdftex}{pdf}{.pdftex}{}



\usepackage[french]{babel}
%\usepackage[latin1]{inputenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}%pour les includegraphics
\usepackage{array}% pour des tableaux particuliers. Nécessaire pour les révéler colonne par colonne
\usepackage{amsthm}
\usepackage{color}
%\usepackage{hyperref}
\usepackage{xspace} % rajouté le 25/05/2009
% On définit le symbole R
\newcommand{\R}{{\fontfamily{cmss}\fontseries{sbc}\fontshape{n}\selectfont R}\xspace}


\newtheorem{thm}{Théorème}
\newtheorem{result}{Résultat}
\newtheorem{boite}{}
\newtheorem{lemme}{Lemme}
\usepackage{bm,txfonts}
\newcommand{\gras}[1]{\ensuremath{\bm{\mathbf {#1}}}}

\newenvironment{cadre}[2]{%
\begin{center}%
$\text{ }$\\%
\fbox{$\text{ }$ $\text{ }$\parbox{0.9\textwidth}{%
$\text{ }$\\%
$\text{ }$\\%
#2%
$\text{ }$\\%
}$\text{ }$ $\text{ }$}
}{%
\end{center}%
}

\def\fleche{%
\begin{center}%
{\Huge \color{blue}$\Downarrow$\normalcolor}%
\end{center}}



\setbeamercovered{transparent}%l'autre option : invisible, cache totalement le texte pas encore découvert (ie, n'utilise pas le ``grisé'').

\colorlet{orange}{red!70!yellow}% mes petites couleurs que j'aime bien
\colorlet{mauve}{blue!70!red}
\colorlet{brouge}{red!70!blue}

\addtobeamertemplate{footline}{$\quad$\insertframenumber/\inserttotalframenumber\phantom{a}}
%pour ajouter un numéro de page en bas.
% une autre solution : \useoutertheme{shadow}


\title[Introductory course on the \R software]{Introductory course on the \R software}
%l'argument entre [] est une version courte du titre, qu'on met en bas des transparents.

\author[Lafaye de Micheaux, Pierre] % (optionnel, utiliser seulement s'il y a beaucoup d'auteurs)
{\textbf{P.~Lafaye de Micheaux}\inst{1}}


\institute[Départements et Universités] % (optionnel, mais nécessaire la plupart du temps)
{
  \inst{1}%
  	Mathematics and Statistics Departement\\
  	Université de Montréal\\
	CANADA
}

\date[2014]{New South Wales University\\
Sydney, Australia\\ May 6, 2014\\
\vspace{1ex}
\url{https://biostatisticien.eu/springeR/courseRw1.pdf}
}

%\AtBeginSection[] % pour mettre la table des matières 
%                 % au début de chaque section
%{ \begin{frame}<beamer> 
%\frametitle{Plan de la présentation} 
%\tableofcontents[currentsection] 
%\end{frame} }

 \pgfdeclareimage[height=96mm,width=128mm]{nombidon}{BatimentGIN}
  \setbeamertemplate{background}{\pgfuseimage{nombidon}}

% \logo{\includegraphics[width=1.5cm]{Rlogo.jpg}}% je définis le logo qui sera mis sur tous les transparents

\setbeamertemplate{background}{transparent}

\usepackage{ragged2e}
\justifying



\usepackage{algpseudocode,algorithm}





\begin{document}


\begin{frame}
\titlepage


\vfill
\end{frame}

%\begin{frame}
%\tableofcontents[pausesections]
%\vspace*{\fill}
%\end{frame}



\section{Introduction}

\section{Audience}


\begin{frame}
\frametitle{Audience: who should attend this course?}


People who expect to:
\begin{itemize}
\item learn the basics of \R (obviously!);
\item want to perform sophisticated data manipulation or non-standard statistical analyses;
\item plan to use it on a regular basis in the future (if not, you will probably forget everything ...).
\end{itemize}

\begin{alertblock}{Level of difficulty}
Matlab users (who can read and produce code) will learn something here ... but I will start with the very basics.
\end{alertblock}


\end{frame}

\begin{frame}
\frametitle{Reference for the course}

\includegraphics[width=10cm]{img/cover.pdf}

\end{frame}


\begin{frame}
\frametitle{Course format}

\begin{itemize}
\item Some ``theory'' and a lot of practice!
\item Each people attending the course should bring his/her own laptop.
\item ``Assignments'' will be given for each future session.
\end{itemize}

\begin{alertblock}{Questions?}
Feel free to interrupt me at any time!
\end{alertblock}

\end{frame}

\begin{frame}
\frametitle{Schedule}
Today (Week 1), we start with the very basics (Chapter 1 and beginning of Chapter 3). \\
$ $\\
Then we could plan weekly meetings to cover other chapters:
\begin{itemize}
\item[Week 2] End of Chapter 3 - Basic Concepts and Data Organisation .
\item[Week 3] Chapter 4 -Importing, Exporting and Producing Data.
\item[Week 4] Chapter 5 - Data Manipulation.
\item[Week 5] Chapter 5 - Functions.
\item[Week 6] Chapter 7- Drawing Curves and Plots.
\item[Week 7] Part of Chapters 8 and 9 - Programming in R; Managing Sessions.
\end{itemize}

\begin{alertblock}{Contact}
Please, fill this blank page with your name and email.
\end{alertblock}

\end{frame}



\begin{frame}
\frametitle{Why use \R?}

\R is:
\begin{itemize}
\item free;
\item open-source;
\item cross-platform (Windows, MacOS, Linux, etc.);
\item rapidly evolving (many packages added each day!).
\end{itemize}

\begin{alertblock}{Warning}
\R is harder to comprehend than other software on the market. You need to spend time learning the syntax and commands to become an efficient user.
\end{alertblock}



\end{frame}

\begin{frame}
\frametitle{Why use \R?}
\R is especially powerful for data manipulation, calculations and plots. Its features include:
\begin{itemize}
\item an integrated and very well conceived documentation system (in English);
\item efficient procedures for data treatment and storage;
\item a suite of operators for calculations on tables, especially matrices (but also arrays);
\item a vast and coherent collection of statistical procedures for data analysis;
\item advanced graphical capabilities;
\item a ``simple'' and efficient programming language, including conditioning, loops, recursion and input-output possibilities.
\end{itemize}

\end{frame}

\begin{frame}[containsverbatim]
\frametitle{Installing \R}

\textbf{Let's start by installing the software!}

\begin{enumerate}
\item Download the file \texttt{R-}\textit{x}\texttt{-win.exe} (where \textit{x} is the number of the latest version) at the address: \url{http://cran.r-project.org/bin/windows/base/}
\item Save this executable file on the Windows Desktop and double-click the file  \texttt{R-}\textit{x}\texttt{-win.exe} (its icon is \includegraphics[width=1cm,height=1cm]{img/setupR} ).
\item The software then installs. Follow the instructions displayed on your screen and keep the default options.
\item When the icon \includegraphics[width=0.7cm,height=0.7cm]{img/iconeR} is added to the Desktop, installation is complete.
\end{enumerate}

\end{frame}

\begin{frame}[containsverbatim]
\frametitle{Installing \R for MacOS or Linux}
Download the file \texttt{R-}\textit{x}\texttt{-snowleopard.pkg} (where \textit{x} is the number of the latest version, i.e. 3.1.0) at the address: \url{http://cran.r-project.org/bin/macosx/}\\

$ $\\
I guess that if you use Linux, you will know how to do it!

\end{frame}


\begin{frame}
\frametitle{\R and Statistics}
Many \textbf{classical} and \textbf{modern} statistical techniques are implemented in \R. The most common methods for statistical analysis, such as:
\begin{itemize}
 \item descriptive statistics;
 \item hypothesis testing;
 \item analysis of variance;
 \item linear regression methods (simple and multiple);
 \item and so on
\end{itemize}
are directly included at the \textbf{core} of the system. \\
$ $\\
Third part of my book covers the following notions: basic mathematics, descriptive statistics, generation of random values, confidence intervals and hypothesis testing, simple and multiple linear regression, elementary analysis of variance.
\end{frame}



\begin{frame}
\frametitle{Extending \R}

Most \textbf{advanced or recent statistical methods} are available through external \textbf{packages}, easy to install from \R (see Section A2. from my Book). \\
$ $\\
They are all grouped and can be browsed on the website of the   \textit{Comprehensive R Archive Network} (CRAN\index{CRAN}):\\
\url{http://cran.r-project.org/web/packages/available_packages_by_name.html}\\
$ $\\
See also the Task Views (on the CRAN) that group packages related to some domains of interest:\\
\url{http://cran.r-project.org/web/views/}

\begin{alertblock}{Official website of \R: The \textbf{C}omprehensive \R \textbf{A}rchive \textbf{N}etwork}
\url{http://cran.r-project.org}
\end{alertblock}

\end{frame}

\begin{frame}
\frametitle{\R and plots}
\begin{figure}[H]
\includegraphics[width=7cm]{img/screenshot.png}
\caption{A few of the graphical possibilities offered by \R.}
\end{figure}
\end{frame}

\begin{frame}
\frametitle{\R and other software}
\R can interact with the following software:
\begin{itemize}
\item use \R from within Excel: \url{http://rcom.univie.ac.at/download.html\#RExcel}
\item \R from within SAS: \url{http://support.sas.com/rnd/app/studio/Rinterface2.html}
\item \R from within SPSS: \url{http://www.ibm.com/developerworks/library/ba-call-r-spss}
\item \R from Matlab: \url{http://www.mathworks.com/matlabcentral/fileexchange/5051-matlab-r-link}
\item Matlab from \R: install package \texttt{R.matlab}
\end{itemize}
\end{frame}



\begin{frame}[containsverbatim]
\frametitle{\R and plots}
Let's play a little bit! Try these commands:
\vspace*{-0.1cm}\begin{verbatim}
demo(image)
example(contour)
demo(graphics)
demo(persp)
demo(plotmath)
demo(Hershey)
install.packages(""lattice)
require("lattice") # Load package, previously installed.
demo(lattice)
example(wireframe)
install.packages("rgl")
require("rgl") 
demo(rgl) #  Interact using your mouse.
example(persp3d)
\end{verbatim}

\end{frame}

\begin{frame}[containsverbatim]
\frametitle{The \R Graphical User Interface}

The \R Graphical User Interface\index{graphical user interface} ({\it i.e.} its set of menus) is very limited, and  completely nonexistent on some operating systems, when compared to other standard software (SPSS say). This minimality can set back some new users. However, this drawback is limited since:
\begin{itemize}
\item it has the didactic advantage that it incites  users to know well the statistical procedures they wish to use;
\item there are additional tools which extend the GUI 
\end{itemize}
\medskip
\textbf{Please, download and install RStudio:}\\ \url{https://www.rstudio.com/ide/download/desktop}\\
$ $\\
We can discuss quickly the RStudio frames.
\end{frame}

\begin{frame}[containsverbatim]
\frametitle{Your first steps in \R}

Please, do by yourself the contents of Section 1.5 of my Book.\\
$ $\\
\url{http://biostatisticien.eu/springeR/Rbook-chap1.pdf}\\
$ $\\
I will stay around and answer your questions.

\begin{alertblock}{Warning}
\begin{itemize}
\item \R Commander (called using \texttt{CommandeR()}) is a tool mostly dedicated for beginners.
\item \R is case sensitive.
\end{itemize}
\end{alertblock}

\end{frame}

\begin{frame}
\vspace*{\fill}
\begin{center}


{\LARGE Thank you for your attention!}
\end{center}
\vspace*{\fill}
\end{frame}

% \bibliographystyle{jss}
% \bibliography{biblio}

\end{document}

