diff --git a/documents/tuto_emacs_windows/.gitkeep b/documents/tuto_emacs_windows/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/documents/tuto_emacs_windows/images/.gitkeep b/documents/tuto_emacs_windows/images/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/documents/tuto_emacs_windows/images/commandeR1.png b/documents/tuto_emacs_windows/images/commandeR1.png new file mode 100644 index 0000000000000000000000000000000000000000..4cf2b5ff05a2aba5d8d54628766298114e8355c6 Binary files /dev/null and b/documents/tuto_emacs_windows/images/commandeR1.png differ diff --git a/documents/tuto_emacs_windows/images/commandeR2.png b/documents/tuto_emacs_windows/images/commandeR2.png new file mode 100644 index 0000000000000000000000000000000000000000..4ed015d5321b05ae187d88bc7df726f2ada4aad8 Binary files /dev/null and b/documents/tuto_emacs_windows/images/commandeR2.png differ diff --git a/documents/tuto_emacs_windows/images/commande_python.png b/documents/tuto_emacs_windows/images/commande_python.png new file mode 100644 index 0000000000000000000000000000000000000000..e7ccc55e56c433fea4063fd607c0d3ef70430a52 Binary files /dev/null and b/documents/tuto_emacs_windows/images/commande_python.png differ diff --git a/documents/tuto_emacs_windows/images/completion.png b/documents/tuto_emacs_windows/images/completion.png new file mode 100644 index 0000000000000000000000000000000000000000..90d4782532cb4ef231d8aee89ef52ed46d9c3a54 Binary files /dev/null and b/documents/tuto_emacs_windows/images/completion.png differ diff --git a/documents/tuto_emacs_windows/images/ctrl_c_c.png b/documents/tuto_emacs_windows/images/ctrl_c_c.png new file mode 100644 index 0000000000000000000000000000000000000000..f19f65b757dbf7b4e4b1a05ac090f272c8433bf6 Binary files /dev/null and b/documents/tuto_emacs_windows/images/ctrl_c_c.png differ diff --git a/documents/tuto_emacs_windows/images/emacs.png b/documents/tuto_emacs_windows/images/emacs.png new file mode 100644 index 0000000000000000000000000000000000000000..8c5057d446f9b567bffe0693e36734c0d4e8ebf0 Binary files /dev/null and b/documents/tuto_emacs_windows/images/emacs.png differ diff --git a/documents/tuto_emacs_windows/images/graphiqueR.png b/documents/tuto_emacs_windows/images/graphiqueR.png new file mode 100644 index 0000000000000000000000000000000000000000..d947e5c16d1f064b60efaa2f60338048a7a088c2 Binary files /dev/null and b/documents/tuto_emacs_windows/images/graphiqueR.png differ diff --git a/documents/tuto_emacs_windows/images/install_matplotlib.png b/documents/tuto_emacs_windows/images/install_matplotlib.png new file mode 100644 index 0000000000000000000000000000000000000000..2a699f6b2c443dd6d82572844c2f04a65669fbe6 Binary files /dev/null and b/documents/tuto_emacs_windows/images/install_matplotlib.png differ diff --git a/documents/tuto_emacs_windows/images/matplotlib.png b/documents/tuto_emacs_windows/images/matplotlib.png new file mode 100644 index 0000000000000000000000000000000000000000..25c8c417019af25b8c9d84845844d23939762f8b Binary files /dev/null and b/documents/tuto_emacs_windows/images/matplotlib.png differ diff --git a/documents/tuto_emacs_windows/images/org_mode.png b/documents/tuto_emacs_windows/images/org_mode.png new file mode 100644 index 0000000000000000000000000000000000000000..ad5e1ef3b67a417a6fa38ff56beddbf4d1d2b154 Binary files /dev/null and b/documents/tuto_emacs_windows/images/org_mode.png differ diff --git a/documents/tuto_emacs_windows/images/python1.png b/documents/tuto_emacs_windows/images/python1.png new file mode 100644 index 0000000000000000000000000000000000000000..dd8c83746bee2e96c9b73b07701b754246dea1ce Binary files /dev/null and b/documents/tuto_emacs_windows/images/python1.png differ diff --git a/documents/tuto_emacs_windows/images/python2.png b/documents/tuto_emacs_windows/images/python2.png new file mode 100644 index 0000000000000000000000000000000000000000..2eabd836c29e11ecd6f83c2a80908fbb0e483bc9 Binary files /dev/null and b/documents/tuto_emacs_windows/images/python2.png differ diff --git a/documents/tuto_emacs_windows/images/python3.png b/documents/tuto_emacs_windows/images/python3.png new file mode 100644 index 0000000000000000000000000000000000000000..8b508bf3a0e8eed0c57d05aa56edc6ab1cc64ec5 Binary files /dev/null and b/documents/tuto_emacs_windows/images/python3.png differ diff --git a/documents/tuto_emacs_windows/images/python4.png b/documents/tuto_emacs_windows/images/python4.png new file mode 100644 index 0000000000000000000000000000000000000000..97c3226cf22cbd9eaaab1e670d9998e0723b0e61 Binary files /dev/null and b/documents/tuto_emacs_windows/images/python4.png differ diff --git a/documents/tuto_emacs_windows/images/scratch.png b/documents/tuto_emacs_windows/images/scratch.png new file mode 100644 index 0000000000000000000000000000000000000000..14e13a41dddcebab6c6767e07648a959994cb87c Binary files /dev/null and b/documents/tuto_emacs_windows/images/scratch.png differ diff --git a/documents/tuto_emacs_windows/images/shell.png b/documents/tuto_emacs_windows/images/shell.png new file mode 100644 index 0000000000000000000000000000000000000000..db6a2829e9577b52c9127cd3b9776329f757b554 Binary files /dev/null and b/documents/tuto_emacs_windows/images/shell.png differ diff --git a/documents/tuto_emacs_windows/tuto_emacs_windows.md b/documents/tuto_emacs_windows/tuto_emacs_windows.md new file mode 100644 index 0000000000000000000000000000000000000000..6efc83adb9f7688b1f4f9240aba1e20a6ef031b6 --- /dev/null +++ b/documents/tuto_emacs_windows/tuto_emacs_windows.md @@ -0,0 +1,150 @@ +1. [Installation et configuration des différents outils](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/tuto_emacs_windows/tuto_emacs_windows.md#1-installation-et-configuration-des-diff%C3%A9rents-outils) + 1. [Installer et configurer Emacs](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/tuto_emacs_windows/tuto_emacs_windows.md#11-installer-et-configurer-emacs) + 2. [Ajouter les chemins de R et Python dans dans la variable PATH de Windows](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/tuto_emacs_windows/tuto_emacs_windows.md#12-ajouter-les-chemins-de-r-et-python-dans-dans-la-variable-path-de-windows) + 3. [Installer et configurer matplotlib (librairie graphique Python)](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/tuto_emacs_windows/tuto_emacs_windows.md#13-installer-et-configurer-matplotlib-librairie-graphique-python) +2. [Utilisation d'Emacs](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/tuto_emacs_windows/tuto_emacs_windows.md#2-utilisation-demacs) + 1. [Exécuter des commandes dos](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/tuto_emacs_windows/tuto_emacs_windows.md#21-ex%C3%A9cuter-des-commandes-dos) + 2. [Exécuter du code R](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/tuto_emacs_windows/tuto_emacs_windows.md#22-ex%C3%A9cuter-du-code-r) + 3. [Exécuter du code Python](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/tuto_emacs_windows/tuto_emacs_windows.md#23-ex%C3%A9cuter-du-code-python) + 4. [Écrire dans le journal](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/tuto_emacs_windows/tuto_emacs_windows.md#24-%C3%89crire-dans-le-journal) + +# **1 Installation et configuration des différents outils** + +## 1.1 Installer et configurer Emacs + +- Installer [Emacs modifié pour Windows](https://vigou3.github.io/emacs-modified-windows/) + - version 26.1 pour Windows 64 bits + - version 25.2 pour Windows 32 bits + +- Télécharger le fichier [rr_org_archive.tgz](https://app-learninglab.inria.fr/gitlab/learning-lab/mooc-rr-ressources/raw/master/module2/ressources/rr_org_archive.tgz) + +Il faut noter qu'avec 7z il faut décompresser l'archive deux fois : une première fois crée une archive `rr_org_archive.tar` et une deuxième fois crée un dossier `rr_org` contenant les fichiers `init.el` et `journal.org`. + +- Lancer Emacs + +![emacs](documents/tuto_emacs_windows/images/emacs.png) + +- Emacs crée le répertoire `C:\Users\***\.emacs.d` + +- Placer le fichier `init.el` dedans + +- Lancer Emacs + +![scratch](documents/tuto_emacs_windows/images/scratch.png) + +- Créer un dossier `C:\Users\***\org` dans l'explorateur Windows + +- Placer le fichier `journal.org` dedans + +--- + +## 1.2 Ajouter les chemins de R et Python dans dans la variable PATH de Windows + +La façon de procéder est très bien expliquée [ici](http://sametmax.com/ajouter-un-chemin-a-la-variable-denvironnement-path-sous-windows/). + +--- + +## 1.3 Installer et configurer matplotlib (librairie graphique Python) + +- Installer la librairie `matplotlib` + + - Ouvrir une invite de commande dos + - Exécuter la commande suivante + +``` +python -m pip install -U matplotlib +``` + +![install_matplotlib](documents/tuto_emacs_windows/images/install_matplotlib.png) + +- Désactiver les plots interactifs dans matplotlib + +Pour ce faire, il faut d'abord savoir où se trouve le fichier de configuration de matplotlib sous Windows. + +Exécuter le code suivant sous Python + +``` +import matplotlib +matplotlib.matplotlib_fname() +``` + +![matplotlib](documents/tuto_emacs_windows/images/matplotlib.png) + +Ouvrir le fichier `matplotlibrc` et ajouter un `#` devant la ligne qui commence par `backend`, ce qui correspond à utiliser la valeur par défaut `Agg` + +--- +--- + +# **2 Utilisation d'Emacs** + +## 2.1 Exécuter des commandes dos + +- Lancer Emacs + +- Créer un fichier toto.org dans l'explorateur Windows + +- Ouvrir le fichier toto.org dans Emacs et saisir ` in () + 1 df_sas = session_sas.df2sd(df_python) + ----> 2 df_sas.describe() + + + f:\program files\python\python37-32\lib\site-packages\saspy\sasbase.py in describe(self) + 1508 :return: + 1509 """ + -> 1510 return self.means() + 1511 + 1512 def means(self): + + + f:\program files\python\python37-32\lib\site-packages\saspy\sasbase.py in means(self) + 1527 code = "proc means data=%s.%s %s stackodsoutput n nmiss median mean std min p25 p50 p75 max; ods output Summary=work._summary; run;" % ( + 1528 self.libref, self.table, self._dsopts()) + -> 1529 return self._returnPD(code, '_summary') + 1530 else: + 1531 if self.HTML: + + + f:\program files\python\python37-32\lib\site-packages\saspy\sasbase.py in _returnPD(self, code, tablename, **kwargs) + 1107 if 'libref' in kwargs: + 1108 libref = kwargs['libref'] + -> 1109 ll = self.sas._io.submit(code) + 1110 check, errorMsg = self._checkLogForError(ll['LOG']) + 1111 if not check: + + + f:\program files\python\python37-32\lib\site-packages\saspy\sasioiom.py in submit(self, code, results, prompt) + 875 self.stdin[0].send(odsclose+logcodei.encode()+b'tom says EOL='+logcodeo+b'\n') + 876 + --> 877 lstf = lstf.decode() + 878 logf = logf.decode() + 879 + + + UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 31798: invalid continuation byte + diff --git a/documents/tuto_jupyter_windows/SASPy4.md b/documents/tuto_jupyter_windows/SASPy4.md new file mode 100644 index 0000000000000000000000000000000000000000..38dadf61b421d1b0366e3bddd7388fe33988e473 --- /dev/null +++ b/documents/tuto_jupyter_windows/SASPy4.md @@ -0,0 +1,118 @@ + +***Import in Python*** + + +```python +import pandas as pd +data_url = "https://forge.scilab.org/index.php/p/rdataset/source/file/master/csv/datasets/cars.csv" +df_python = pd.read_csv(data_url) +df_python.drop(df_python.columns[[0]], axis=1, inplace=True) +``` + +***Describe in SAS*** + + +```python +import saspy +session_sas = saspy.SASsession(cfgname='winlocal') +``` + + SAS Connection established. Subprocess id is 6784 + + + + +```python +session_sas +``` + + + + + Access Method = IOM + SAS Config name = winlocal + WORK Path = / + SAS Version = 9.04.01M1P12042013 + SASPy Version = 2.2.6 + Teach me SAS = False + Batch = False + Results = Pandas + SAS Session Encoding = WLATIN1 + Python Encoding value = windows-1252 + + + + +```python +df_sas = session_sas.df2sd(df_python) +df_sas.describe() +``` + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariableNNMissMedianMeanStdDevMinP25P50P75Max
0speed5001515.405.287644412151925
1dist5003642.9825.7693772263656120
+
+ + diff --git a/documents/tuto_jupyter_windows/Test_SASkernel.html b/documents/tuto_jupyter_windows/Test_SASkernel.html new file mode 100644 index 0000000000000000000000000000000000000000..4ad34b6a83dda2f42d7a5aedc56b5366225e46b1 --- /dev/null +++ b/documents/tuto_jupyter_windows/Test_SASkernel.html @@ -0,0 +1,15488 @@ + + + + +Test_SASkernel + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+

Test SASkernel

+
+
+
+
+
+
In [1]:
+
+
+
proc print data=sashelp.class (obs=3);
+run;
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
SAS Connection established. Subprocess id is 5852
+
+
+
+
+ +
+ +
Out[1]:
+ + + +
+ + + + + +Sortie SAS + + + +

Sortie SAS

+
+
+

Le Système SAS

+
+

La PRINT Procédure

+
+

Table SASHELP.CLASS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Obs.NameSexAgeHeightWeight
1AlfredM1469.0112.5
2AliceF1356.584.0
3BarbaraF1365.398.0
+
+
+ + + +
+ +
+ +
+
+ +
+
+
+
In [2]:
+
+
+
proc means data=sashelp.class;
+  var Age Height Weight; 
+run;
+
+ +
+
+
+ +
+
+ + +
+ +
Out[2]:
+ + + +
+ + + + + +Sortie SAS + + + +

Sortie SAS

+
+
+

Le Système SAS

+
+
+

Procédure MEANS

+
+

La MEANS Procédure

+
+

Statistiques descriptives

+ + + + + + + + + + + + + + + + + + + + + + +
VariableNMoyenneEcart-typeMinimumMaximum
+
+
Age
+
Height
+
Weight
+
+
+
+
19
+
19
+
19
+
+
+
+
13.3157895
+
62.3368421
+
100.0263158
+
+
+
+
1.4926722
+
5.1270752
+
22.7739335
+
+
+
+
11.0000000
+
51.3000000
+
50.5000000
+
+
+
+
16.0000000
+
72.0000000
+
150.0000000
+
+
+
+
+ + + +
+ +
+ +
+
+ +
+
+
+
In [ ]:
+
+
+

+
+ +
+
+
+ +
+
+
+ + + + + + diff --git a/documents/tuto_jupyter_windows/Test_SASkernel.md b/documents/tuto_jupyter_windows/Test_SASkernel.md new file mode 100644 index 0000000000000000000000000000000000000000..2f49ca076a4db39ee80589d94c304441c3c00f56 --- /dev/null +++ b/documents/tuto_jupyter_windows/Test_SASkernel.md @@ -0,0 +1,2347 @@ +--- +output: + pdf_document: default + html_document: default +--- +# Test SASkernel + + +```sas +proc print data=sashelp.class (obs=3); +run; +``` + + SAS Connection established. Subprocess id is 5852 + + + + + + + + + + + +Sortie SAS + + + +

Sortie SAS

+
+
+

Le Système SAS

+
+

La PRINT Procédure

+
+

Table SASHELP.CLASS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Obs.NameSexAgeHeightWeight
1AlfredM1469.0112.5
2AliceF1356.584.0
3BarbaraF1365.398.0
+
+
+ + + + + + + +```sas +proc means data=sashelp.class; + var Age Height Weight; +run; +``` + + + + + + + + + +Sortie SAS + + + +

Sortie SAS

+
+
+

Le Système SAS

+
+
+

Procédure MEANS

+
+

La MEANS Procédure

+
+

Statistiques descriptives

+ + + + + + + + + + + + + + + + + + + + + + +
VariableNMoyenneEcart-typeMinimumMaximum
+
+
Age
+
Height
+
Weight
+
+
+
+
19
+
19
+
19
+
+
+
+
13.3157895
+
62.3368421
+
100.0263158
+
+
+
+
1.4926722
+
5.1270752
+
22.7739335
+
+
+
+
11.0000000
+
51.3000000
+
50.5000000
+
+
+
+
16.0000000
+
72.0000000
+
150.0000000
+
+
+
+
+ + + + + + + +```sas + +``` diff --git a/documents/tuto_jupyter_windows/Test_SASkernel.pdf b/documents/tuto_jupyter_windows/Test_SASkernel.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ca038967d2a7d627d6749888d688fa4ff8dce608 Binary files /dev/null and b/documents/tuto_jupyter_windows/Test_SASkernel.pdf differ diff --git a/documents/tuto_jupyter_windows/images/.gitkeep b/documents/tuto_jupyter_windows/images/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/documents/tuto_jupyter_windows/images/sascfg1.png b/documents/tuto_jupyter_windows/images/sascfg1.png new file mode 100644 index 0000000000000000000000000000000000000000..57f4c3c3a164c08b38830ae6490fadeadba19ee4 Binary files /dev/null and b/documents/tuto_jupyter_windows/images/sascfg1.png differ diff --git a/documents/tuto_jupyter_windows/images/sascfg2.png b/documents/tuto_jupyter_windows/images/sascfg2.png new file mode 100644 index 0000000000000000000000000000000000000000..42618e415b3fcd98791646585100944daa97c3f1 Binary files /dev/null and b/documents/tuto_jupyter_windows/images/sascfg2.png differ diff --git a/documents/tuto_jupyter_windows/notebook_python.ipynb b/documents/tuto_jupyter_windows/notebook_python.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..d5c689057613afd1abba7df24707128b067d7cbe --- /dev/null +++ b/documents/tuto_jupyter_windows/notebook_python.ipynb @@ -0,0 +1,39 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Notebook Python" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.0" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/documents/tuto_jupyter_windows/tuto_jupyter_windows.md b/documents/tuto_jupyter_windows/tuto_jupyter_windows.md new file mode 100644 index 0000000000000000000000000000000000000000..af7ed127e3bcddedb666cf163208275c85289b35 --- /dev/null +++ b/documents/tuto_jupyter_windows/tuto_jupyter_windows.md @@ -0,0 +1,165 @@ +# 1 Installer Python + +- Installer Python + +- Ajouter les chemins de Python et Python\Scripts dans dans la variable PATH de Windows + +La façon de procéder est très bien expliquée [ici](http://sametmax.com/ajouter-un-chemin-a-la-variable-denvironnement-path-sous-windows/). + +--- + +# 2 Installer le package Jupyter + +- Méthode pour installer un package + - Ouvrir une invite de commande dos + - Exécuter la commande suivante + +``` +pip install jupyter +``` + +NB : Le raccourci `^v` ne fonctionne pas dans l'invite de commande dos. La fonction "coller" est disponible avec le bouton droit de la souris. + +--- + +# 3 Lancer Jupyper + +- Ouvrir une invite de commande dos + +- Exécuter la commande suivante + +``` +jupyter notebook +``` + +--- + +# 4 Autres langages + +Jupyper permet par défaut d'exécuter du code Python. Des packages permettent d'exécuter d'autres langages. + +## 4.1 Le package R [IRKernel](https://github.com/IRkernel/IRkernel) permet d'exécuter du code R dans un notebook R + +- Lancer R ou RStudio + +- Installer le package devtools + +``` +install.packages('devtools',dep=TRUE) +``` + +- Définir le proxy le cas échéant + +``` +library(httr) +set_config(use_proxy(url="proxy", port=80, username="username", password="password")) +``` + +- Installer IRkernel + +``` +devtools::install_github('IRkernel/IRkernel') +IRkernel::installspec() # to register the kernel in the current R installation +``` + +- On peut alors créer un notebook R + +![new_notebook](documents/tuto_jupyter_windows/images/new_notebook.png) + +![notebook_R](documents/tuto_jupyter_windows/images/notebook_R.png) + +On remarque l'icône du logiciel R en haut à droite. + +- [Exemple de notebook R](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/notebooks_jupyter/notebook_R/notebook_R.ipynb) + +- Lien utile : http://r.789695.n4.nabble.com/Problem-with-IRkernel-Installation-Solved-Instructions-on-how-to-Solve-it-td4727912.html + +--- + +## 4.2 Le package Python **rpy2** permet d'exécuter du code R dans un notebook Python + +- Le package `rpy2` s'installe difficilement par méthode standard. + +- Télécharger le fichier binaire qui correspond au système d'exploitation [ici](https://www.lfd.uci.edu/~gohlke/pythonlibs/#rpy2) + +- Ouvrir une invite de commande dos + +- Se placer dans le dossier de télécharment + +- Exécuter la commande suivante + +``` +python -m pip install rpy2‑2.9.4‑cp37‑cp37m‑win_amd64.whl # adapter le nom du fichier +``` + +- Lancer Jupiter et créer un notebook Python + +- Exécuter la commande suivante + +``` +%load_ext rpy2.ipython +``` + +- Installer le package `tzlocal` à l'aide de la commande `pip` + +- [Exemple de notebook Python/R](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/notebooks_jupyter/notebook_Python_R/notebook_Python_R.ipynb) + +- Lien utile : https://stackoverflow.com/questions/14882477/rpy2-install-on-windows-7 + +NB : Je n'ai pas eu besoin de définir les variables d'environnement R_HOME et R_USER. + +--- + +## 4.3 Le package Python [SASKernel](https://sassoftware.github.io/sas_kernel/) permet d'exécuter du code SAS dans un notebook SAS + +- Installer le package `sas_kernel` à l'aide de la commande `pip` + +- Modifier le fichier C:\Program Files\Python\Python37\Lib\site-packages\saspy\sascfg_sav.py pour l'adapter à votre système + +Dans les deux images ci-dessous, la fenêtre de gauche correspond au fichier initial et celle de droite au fichier modifié. + +![sascfg1](documents/tuto_jupyter_windows/images/sascfg1.png) + +![sascfg2](documents/tuto_jupyter_windows/images/sascfg2.png) + +- On peut alors créer un notebook SAS + +![new_notebook](documents/tuto_jupyter_windows/images/new_notebook.png) + +![notebook_SAS](documents/tuto_jupyter_windows/images/notebook_SAS.png) + +On remarque l'icône du logiciel SAS en haut à droite. + +- [Exemple de notebook SAS](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/notebooks_jupyter/notebook_SAS/notebook_SAS.ipynb) + +- NB : L'export Jupyter vers pdf ne fonctionne pas pour les sorties HTML et donc SAS. Il est possible de faire l'export depuis pandoc. + + - Exporter le document au format HTML + - Exécuter la commande suivante + +``` +pandoc --variable=geometry:a4paper --variable=geometry:margin=1in notebook_sas.html -o notebook_sas.pdf +``` + +mais ça ne marche pas pour tous les tableaux et on perd la coloration syntaxique. + +- Lien utile : https://sassoftware.github.io/sas_kernel/install.html + +--- + +## 4.4 Le package Python [SASPy](https://sassoftware.github.io/saspy/) permet d'exécuter du code SAS dans un notebook Python + +- Installer le package `saspy` à l'aide de la commande `pip` + +- [Exemple de notebook Python/SAS] (https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/master/documents/notebooks_jupyter/notebook_Python_SAS/notebook_Python_SAS.ipynb) + +- NB : L'export Jupyter vers pdf ne fonctionne pas pour les sorties HTML et donc SAS. Il est possible de faire l'export depuis pandoc. + + - Exporter le document au format HTML + - Exécuter la commande suivante + +``` +pandoc --variable=geometry:a4paper --variable=geometry:margin=1in notebook_sas.html -o notebook_sas.pdf +``` + +mais ça ne marche pas pour tous les tableaux et on perd la coloration syntaxique. diff --git a/documents/tuto_jupyter_windows/tuto_jupyter_windows_v2.html b/documents/tuto_jupyter_windows/tuto_jupyter_windows_v2.html new file mode 100644 index 0000000000000000000000000000000000000000..bca9bfcdf7c60262357969c91aa39ee8955e8ca9 --- /dev/null +++ b/documents/tuto_jupyter_windows/tuto_jupyter_windows_v2.html @@ -0,0 +1,554 @@ + + + + + + + + + + + + + +Tuto Jupyter Windows + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +

https://gitlab.inria.fr/learninglab/mooc-rr/mooc-rr-ressources/blob/master/module2/ressources/jupyter_fr.org

+

FUN : Jupyter : trucs et astuces, Installation et configuration

+
+

1 Installer Python

+
    +
  • Installer Python

  • +
  • Ajouter les chemins de Python et Python\Scripts dans la variable PATH de Windows

  • +
+

La façon de procéder est très bien expliquée ici.

+
+
+
+

2 Installer le package Jupyter

+
    +
  • Méthode pour installer un package
  • +
  • Ouvrir une invite de commande dos
  • +
  • Exécuter la commande suivante
  • +
+
pip install jupyter
+

NB : Le raccourci ^v ne fonctionne pas dans l’invite de commande dos. La fonction “coller” est disponible avec le bouton droit de la souris.

+
+
+
+

3 Lancer Jupyper

+
    +
  • Ouvrir une invite de commande dos

  • +
  • Exécuter la commande suivante

  • +
+
jupyter notebook
+
+
+
+

4 Autres langages

+

Jupyper permet par défaut d’exécuter du code Python. Des packages permettent d’exécuter d’autres langages.

+
+

4.1 Le package R IRkernel permet d’exécuter du code R dans un notebook R

+
    +
  • Lancer R ou RStudio

  • +
  • Installer le package IRkernel

  • +
+
install.packages("IRkernel",dep=TRUE)
+IRkernel::installspec()  # to register the kernel in the current R installation
+
> packageVersion("IRkernel")
+[1] ‘1.1’
+
+

Anciennement :

+
    +
  • Installer le package devtools
  • +
+
install.packages('devtools',dep=TRUE)
+
    +
  • Définir le proxy le cas échéant
  • +
+
library(httr)
+set_config(use_proxy(url="proxy", port=80, username="username", password="password")) 
+
    +
  • Installer IRkernel
  • +
+
devtools::install_github('IRkernel/IRkernel')
+IRkernel::installspec()  # to register the kernel in the current R installation
+ +
+
+

4.2 Le package Python rpy2 permet d’exécuter du code R dans un notebook Python

+
    +
  • Le package rpy2 s’installe difficilement par méthode standard.

  • +
  • Télécharger le fichier binaire qui correspond au système d’exploitation ici

  • +
  • Ouvrir une invite de commande dos

  • +
  • Se placer dans le dossier de télécharment

  • +
  • Exécuter la commande suivante

  • +
+
python -m pip install rpy2‑2.9.4‑cp37‑cp37m‑win_amd64.whl # adapter le nom du fichier
+
    +
  • Lancer Jupiter et créer un notebook Python

  • +
  • Exécuter la commande suivante

  • +
+
%load_ext rpy2.ipython
+ +

NB : Je n’ai pas eu besoin de définir les variables d’environnement R_HOME et R_USER.

+
+
+

4.3 Le package Python SASKernel permet d’exécuter du code SAS dans un notebook SAS

+
    +
  • Installer le package sas_kernel à l’aide de la commande pip

  • +
  • Modifier le fichier C:\Program Files\Python\Python37\Lib\site-packages\saspy\sascfg_sav.py pour l’adapter à votre système

  • +
+

Dans les deux images ci-dessous, la fenêtre de gauche correspond au fichier initial et celle de droite au fichier modifié.

+
+ +

sascfg1

+
+
+ +

sascfg2

+
+ +
+
    +
  • Problèmes rencontrés
  • +
+
Pandas module not available.
+

–> Installer le package pandas à l’aide de la commande pip

+
Attempted to run program C:\\Program Files\\SASHome\\SASPrivateJavaRuntimeEnvironment\\9.4\\jrin\\java
+

–> Vérifier que tous les antislashs sont doublés

+
Be sure the path to sspiauth.dll is in your System PATH
+

–> Ajouter le chemin C:\Program Files\SASHOME\SASFoundation\9.4\core\sasext dans la variable PATH de Windows

+
+
+
+

4.4 Le package Python SASPy permet d’exécuter du code SAS dans un notebook Python

+
    +
  • Installer le package saspy à l’aide de la commande pip
  • +
+
+
+ + + + +
+ + + + + + + + + + + + + + + diff --git a/documents/tuto_jupyter_windows/tuto_jupyter_windows_v2.md b/documents/tuto_jupyter_windows/tuto_jupyter_windows_v2.md new file mode 100644 index 0000000000000000000000000000000000000000..665472f2c89cc8f20e8aedad4fa3fae617618b62 --- /dev/null +++ b/documents/tuto_jupyter_windows/tuto_jupyter_windows_v2.md @@ -0,0 +1,167 @@ +--- +title: "Tuto Jupyter Windows" +--- + +https://gitlab.inria.fr/learninglab/mooc-rr/mooc-rr-ressources/blob/master/module2/ressources/jupyter_fr.org + +[FUN : Jupyter : trucs et astuces, Installation et configuration](https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/courseware/66bc811404b8481da5f794de54681c5e/f8608bfb261b4c289b35b2cd19d5baf3/3?activate_block_id=block-v1%3Ainria%2B41016%2Bsession02%2Btype%40vertical%2Bblock%404ab5bb42ca1e45c8b0f349751b96d405#installation-et-configuration-de-jupyter-sur-votre-ordinateur) + +# 1 Installer Python + +- Installer Python + +- Ajouter les chemins de Python et Python\\Scripts dans la variable PATH de Windows + +La façon de procéder est très bien expliquée [ici](http://sametmax.com/ajouter-un-chemin-a-la-variable-denvironnement-path-sous-windows/). + +--- + +# 2 Installer le package Jupyter + +- Méthode pour installer un package + - Ouvrir une invite de commande dos + - Exécuter la commande suivante + +``` +pip install jupyter +``` + +NB : Le raccourci `^v` ne fonctionne pas dans l'invite de commande dos. La fonction "coller" est disponible avec le bouton droit de la souris. + +--- + +# 3 Lancer Jupyper + +- Ouvrir une invite de commande dos + +- Exécuter la commande suivante + +``` +jupyter notebook +``` + +--- + +# 4 Autres langages + +Jupyper permet par défaut d'exécuter du code Python. Des packages permettent d'exécuter d'autres langages. + +## 4.1 Le package R [IRkernel](https://irkernel.github.io/installation/) permet d'exécuter du code R dans un notebook R + +- Lancer R ou RStudio + +- Installer le package IRkernel + +``` +install.packages("IRkernel",dep=TRUE) +IRkernel::installspec() # to register the kernel in the current R installation +``` + +``` +> packageVersion("IRkernel") +[1] ‘1.1’ +``` + +--- + +Anciennement : + +- Installer le package devtools + +``` +install.packages('devtools',dep=TRUE) +``` + +- Définir le proxy le cas échéant + +``` +library(httr) +set_config(use_proxy(url="proxy", port=80, username="username", password="password")) +``` + +- Installer IRkernel + +``` +devtools::install_github('IRkernel/IRkernel') +IRkernel::installspec() # to register the kernel in the current R installation +``` + +- Lien utile : http://r.789695.n4.nabble.com/Problem-with-IRkernel-Installation-Solved-Instructions-on-how-to-Solve-it-td4727912.html + +## 4.2 Le package Python **rpy2** permet d'exécuter du code R dans un notebook Python + +- Le package `rpy2` s'installe difficilement par méthode standard. + +- Télécharger le fichier binaire qui correspond au système d'exploitation [ici](https://www.lfd.uci.edu/~gohlke/pythonlibs/#rpy2) + +- Ouvrir une invite de commande dos + +- Se placer dans le dossier de télécharment + +- Exécuter la commande suivante + +``` +python -m pip install rpy2‑2.9.4‑cp37‑cp37m‑win_amd64.whl # adapter le nom du fichier +``` + +- Lancer Jupiter et créer un notebook Python + +- Exécuter la commande suivante + +``` +%load_ext rpy2.ipython +``` + +- S'il y a un message d'erreur `ModuleNotFoundError`, le nom du module manquant est indiqué à la fin du [message](https://app-learninglab.inria.fr/gitlab/85bc36e0a8096c618fbd5993d1cca191/mooc-rr/blob/5a2d28a2b1c0491ffa6b9665e384d769e27e1296/documents/tuto_jupyter_windows/tzlocal_not_found.html) + +- Installer le module manquant avec la commande pip. (Le module tzlocal peut être installé directement. Il n'est pas nécessaire de le télécharger.) + +- Lien utile : https://stackoverflow.com/questions/14882477/rpy2-install-on-windows-7 + +NB : Je n'ai pas eu besoin de définir les variables d'environnement R_HOME et R_USER. + +## 4.3 Le package Python [SASKernel](https://sassoftware.github.io/sas_kernel/) permet d'exécuter du code SAS dans un notebook SAS + +- Installer le package `sas_kernel` à l'aide de la commande `pip` + +- Modifier le fichier C:\\Program Files\\Python\\Python37\\Lib\\site-packages\\saspy\\sascfg_sav.py pour l'adapter à votre système + +Dans les deux images ci-dessous, la fenêtre de gauche correspond au fichier initial et celle de droite au fichier modifié. + +![sascfg1](D:/inserm/mooc/recherche_reproductible/mooc-rr/documents/tuto_jupyter_windows/images/sascfg1.png) + +![sascfg2](D:/inserm/mooc/recherche_reproductible/mooc-rr/documents/tuto_jupyter_windows/images/sascfg2.png) + +- Installer le package `pandas` à l'aide de la commande `pip` + +- Ajouter le chemin C:\\Program Files\\SASHOME\\SASFoundation\\9.4\\core\\sasext dans la variable PATH de Windows + +- Lien utile : https://sassoftware.github.io/sas_kernel/install.html + +--- + +- Problèmes rencontrés + +``` +Pandas module not available. +``` + +--> Installer le package `pandas` à l'aide de la commande `pip` + +``` +Attempted to run program C:\\Program Files\\SASHome\\SASPrivateJavaRuntimeEnvironment\\9.4\\jrin\\java +``` + +--> Vérifier que tous les antislashs sont doublés + +``` +Be sure the path to sspiauth.dll is in your System PATH +``` + +--> Ajouter le chemin C:\\Program Files\\SASHOME\\SASFoundation\\9.4\\core\\sasext dans la variable PATH de Windows + +--- + +## 4.4 Le package Python [SASPy](https://sassoftware.github.io/saspy/) permet d'exécuter du code SAS dans un notebook Python + +- Installer le package `saspy` à l'aide de la commande `pip` diff --git a/documents/tuto_jupyter_windows/tzlocal_not_found.html b/documents/tuto_jupyter_windows/tzlocal_not_found.html new file mode 100644 index 0000000000000000000000000000000000000000..a88090e2d58eb53103cf56a883ce7b743401fc41 --- /dev/null +++ b/documents/tuto_jupyter_windows/tzlocal_not_found.html @@ -0,0 +1,11883 @@ + + + +Untitled + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
In [1]:
+
+
+
%load_ext rpy2.ipython
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
+---------------------------------------------------------------------------
+ModuleNotFoundError                       Traceback (most recent call last)
+<ipython-input-1-fb23c6edefe4> in <module>()
+----> 1 get_ipython().run_line_magic('load_ext', 'rpy2.ipython')
+
+c:\program files\python\python37\lib\site-packages\IPython\core\interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
+   2129                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
+   2130             with self.builtin_trap:
+-> 2131                 result = fn(*args,**kwargs)
+   2132             return result
+   2133 
+
+<decorator-gen-66> in load_ext(self, module_str)
+
+c:\program files\python\python37\lib\site-packages\IPython\core\magic.py in <lambda>(f, *a, **k)
+    185     # but it's overkill for just that one bit of state.
+    186     def magic_deco(arg):
+--> 187         call = lambda f, *a, **k: f(*a, **k)
+    188 
+    189         if callable(arg):
+
+c:\program files\python\python37\lib\site-packages\IPython\core\magics\extension.py in load_ext(self, module_str)
+     31         if not module_str:
+     32             raise UsageError('Missing module name.')
+---> 33         res = self.shell.extension_manager.load_extension(module_str)
+     34 
+     35         if res == 'already loaded':
+
+c:\program files\python\python37\lib\site-packages\IPython\core\extensions.py in load_extension(self, module_str)
+     83             if module_str not in sys.modules:
+     84                 with prepended_to_syspath(self.ipython_extension_dir):
+---> 85                     mod = import_module(module_str)
+     86                     if mod.__file__.startswith(self.ipython_extension_dir):
+     87                         print(("Loading extensions from {dir} is deprecated. "
+
+c:\program files\python\python37\lib\importlib\__init__.py in import_module(name, package)
+    125                 break
+    126             level += 1
+--> 127     return _bootstrap._gcd_import(name[level:], package, level)
+    128 
+    129 
+
+c:\program files\python\python37\lib\importlib\_bootstrap.py in _gcd_import(name, package, level)
+
+c:\program files\python\python37\lib\importlib\_bootstrap.py in _find_and_load(name, import_)
+
+c:\program files\python\python37\lib\importlib\_bootstrap.py in _find_and_load_unlocked(name, import_)
+
+c:\program files\python\python37\lib\importlib\_bootstrap.py in _load_unlocked(spec)
+
+c:\program files\python\python37\lib\importlib\_bootstrap_external.py in exec_module(self, module)
+
+c:\program files\python\python37\lib\importlib\_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)
+
+c:\program files\python\python37\lib\site-packages\rpy2\ipython\__init__.py in <module>()
+----> 1 from .rmagic import load_ipython_extension
+
+c:\program files\python\python37\lib\site-packages\rpy2\ipython\rmagic.py in <module>()
+     83   template_converter += numpy2ri.converter
+     84   if pandas:
+---> 85     from rpy2.robjects import pandas2ri
+     86     template_converter += pandas2ri.converter
+     87 
+
+c:\program files\python\python37\lib\site-packages\rpy2\robjects\pandas2ri.py in <module>()
+     21 import numpy
+     22 import pytz
+---> 23 import tzlocal
+     24 import warnings
+     25 
+
+ModuleNotFoundError: No module named 'tzlocal'
+
+
+ +
+
+ +
+
+
+ + + + + + diff --git a/documents/tuto_magit/.gitkeep b/documents/tuto_magit/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/documents/tuto_magit/images/.gitkeep b/documents/tuto_magit/images/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/documents/tuto_magit/images/git1.png b/documents/tuto_magit/images/git1.png new file mode 100644 index 0000000000000000000000000000000000000000..f6721fdac3580626d220049e5c1606403b49fa4f Binary files /dev/null and b/documents/tuto_magit/images/git1.png differ diff --git a/documents/tuto_magit/tuto_magit.md b/documents/tuto_magit/tuto_magit.md new file mode 100644 index 0000000000000000000000000000000000000000..b4e730faae902ee191e1c6cbccd2f71bfa18ac8a --- /dev/null +++ b/documents/tuto_magit/tuto_magit.md @@ -0,0 +1,32 @@ +# 1 Installer Magit + +Plusieurs méthodes sont proposées [ici] (https://magit.vc/manual/magit/Installing-from-an-Elpa-Archive.html). + +Celle-ci a été testée sur Windows : + +- Ajouter le code suivant dans le fichier `.emacs.d/init.el` + +``` +(require 'package) +(add-to-list 'package-archives + '("melpa" . "http://melpa.org/packages/") t) +``` + +- Lancer Emacs et exécuter les commandes suivantes + +``` +M-x package-refresh-contents RET +M-x package-install RET magit RET +``` + +NB : `M-` correspond à la touche ``, `RET` à la touche `` + +# 2 Lancer Magit + +- Ouvrir un fichier et exécuter le racourci `C-x g` + +- Magit demande le chemin du répertoire Git + +- Indiquer le chemin du répertoire mooc-rr + +![git1](documents/tuto_magit/images/git1.png) \ No newline at end of file diff --git a/documents/tuto_rstudio_gitlab/.gitkeep b/documents/tuto_rstudio_gitlab/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/documents/tuto_rstudio_gitlab/images/.gitkeep b/documents/tuto_rstudio_gitlab/images/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/documents/tuto_rstudio_gitlab/images/adresse_depot.png b/documents/tuto_rstudio_gitlab/images/adresse_depot.png new file mode 100644 index 0000000000000000000000000000000000000000..684b44f96d93fa06e11b78c5d76463ff8a655c2d Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/adresse_depot.png differ diff --git a/documents/tuto_rstudio_gitlab/images/clone.png b/documents/tuto_rstudio_gitlab/images/clone.png new file mode 100644 index 0000000000000000000000000000000000000000..15e114e2d61116e094d51560efaf467574072b1c Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/clone.png differ diff --git a/documents/tuto_rstudio_gitlab/images/commit.png b/documents/tuto_rstudio_gitlab/images/commit.png new file mode 100644 index 0000000000000000000000000000000000000000..28734012e7d203634959cdd038779dd44c6c0097 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/commit.png differ diff --git a/documents/tuto_rstudio_gitlab/images/commit2.png b/documents/tuto_rstudio_gitlab/images/commit2.png new file mode 100644 index 0000000000000000000000000000000000000000..0c26431fe55b199e5bbf869c24d43f8a5323ec8e Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/commit2.png differ diff --git a/documents/tuto_rstudio_gitlab/images/commit3.png b/documents/tuto_rstudio_gitlab/images/commit3.png new file mode 100644 index 0000000000000000000000000000000000000000..20f3a13e74efa4e0fc92a9fb5c38ea7adae29888 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/commit3.png differ diff --git a/documents/tuto_rstudio_gitlab/images/commit4.png b/documents/tuto_rstudio_gitlab/images/commit4.png new file mode 100644 index 0000000000000000000000000000000000000000..1e18eff4e27724f3b64d38a73535c964d9922673 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/commit4.png differ diff --git a/documents/tuto_rstudio_gitlab/images/commit5.png b/documents/tuto_rstudio_gitlab/images/commit5.png new file mode 100644 index 0000000000000000000000000000000000000000..514ec36856d919fe20f2762cd5783c5b0c490b06 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/commit5.png differ diff --git a/documents/tuto_rstudio_gitlab/images/git.png b/documents/tuto_rstudio_gitlab/images/git.png new file mode 100644 index 0000000000000000000000000000000000000000..290631cae3df2c22786cda60a1a9fa8b95598189 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/git.png differ diff --git a/documents/tuto_rstudio_gitlab/images/new_project.png b/documents/tuto_rstudio_gitlab/images/new_project.png new file mode 100644 index 0000000000000000000000000000000000000000..27a245e7fd062e666317f5e9172b6db7b4e85782 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/new_project.png differ diff --git a/documents/tuto_rstudio_gitlab/images/password_proxy.png b/documents/tuto_rstudio_gitlab/images/password_proxy.png new file mode 100644 index 0000000000000000000000000000000000000000..2c377c0387174efaa1a8b51f6d1fa28dc5066450 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/password_proxy.png differ diff --git a/documents/tuto_rstudio_gitlab/images/push.png b/documents/tuto_rstudio_gitlab/images/push.png new file mode 100644 index 0000000000000000000000000000000000000000..5e4b0190156fc9e342656f4b25a47d099dc3a288 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/push.png differ diff --git a/documents/tuto_rstudio_gitlab/images/push2.png b/documents/tuto_rstudio_gitlab/images/push2.png new file mode 100644 index 0000000000000000000000000000000000000000..9e0352d7e3ac45c3fdf92f770e69f8a2865a7915 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/push2.png differ diff --git a/documents/tuto_rstudio_gitlab/images/push3.png b/documents/tuto_rstudio_gitlab/images/push3.png new file mode 100644 index 0000000000000000000000000000000000000000..2aef7e727965bbc425f9843813335a20a41f2f09 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/push3.png differ diff --git a/documents/tuto_rstudio_gitlab/images/push4.png b/documents/tuto_rstudio_gitlab/images/push4.png new file mode 100644 index 0000000000000000000000000000000000000000..7b27dfceeb87ce3864f6377661f81ae9b1d00816 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/push4.png differ diff --git a/documents/tuto_rstudio_gitlab/images/rstudio.png b/documents/tuto_rstudio_gitlab/images/rstudio.png new file mode 100644 index 0000000000000000000000000000000000000000..f856d763e49e05c6545936de70d335361c90dd41 Binary files /dev/null and b/documents/tuto_rstudio_gitlab/images/rstudio.png differ diff --git a/documents/tuto_rstudio_gitlab/tuto_rstudio_gitlab.md b/documents/tuto_rstudio_gitlab/tuto_rstudio_gitlab.md new file mode 100644 index 0000000000000000000000000000000000000000..b126e7607f4dfe877ca1d0f8e520f2444397aceb --- /dev/null +++ b/documents/tuto_rstudio_gitlab/tuto_rstudio_gitlab.md @@ -0,0 +1,92 @@ +# Dans Git + +- Enregistrer l'email et le nom de l'utilisateur + +``` +git config --global --user.email you@example.com +git config --global --user.name Your Name +``` + +NB : Ne pas mettre de guillemets. + +Ces deux paramètres sont obligatoire pour pouvoir commiter sinon on obtient le message suivant + +![commit3](documents/tuto_rstudio_gitlab/images/commit3.png) + +- Si vous êtes derrière un proxy, il faut le définir dans Git + +``` +git config --global http.proxy http://proxy.server.com:port +``` + +On peut aussi définir le proxyUsername pour n'avoir que le mot de passe à saisir + +``` +git config --global http.proxy http://proxyUsername@proxy.server.com:port +``` + +- Option pour que le login et mot de passe soient enregistrés pendant 1 heure + +``` +git config --global credential.helper "cache --timeout=3600" +``` + +# Dans RStudio + +- File / New Project / Version Control + +![new_project](documents/tuto_rstudio_gitlab/images/new_project.png) + +![git](documents/tuto_rstudio_gitlab/images/git.png) + +- Récupérer l'adresse du dépôt + +![adresse_depot](documents/tuto_rstudio_gitlab/images/adresse_depot.png) + +- Indiquer l'adresse du dépôt dans le champ "Repository URL" +- Il est possible de faire précéder l'adresse du dépôt par `xxx@`, xxx étant l'identifiant Gitlab, pour ne pas avoir à le renseigner par la suite + +![clone](documents/tuto_rstudio_gitlab/images/clone.png) + +- Si vous êtes derrière un proxy, il faut le définir dans Git +- Git demande le mot de passe du proxy + +![password_proxy](documents/tuto_rstudio_gitlab/images/password_proxy.png) + +- Git se connecte à Gitlab et récupère l'ensemble des données + +- RStudio redémarre pour se placer dans un mode lié à Git + +![rstudio](documents/tuto_rstudio_gitlab/images/rstudio.png) + +- Module2 / exo1 / toy_document.Rmd + +- Modifier le fichier + +- Sauvegarder + +- Aller dans Git pour effectuer le commit + +![commit](documents/tuto_rstudio_gitlab/images/commit.png) + +![commit2](documents/tuto_rstudio_gitlab/images/commit2.png) + +- Sélectionner les lignes à commiter puis cliquer sur "commit" + +![commit5](documents/tuto_rstudio_gitlab/images/commit5.png) + +Les modifications sont pour l'instant uniquement sur la machine. Elles n'ont pas été propagées sur Gitlab. + +- Cliquer sur "push" pour les propager sur Gitlab + +![push](documents/tuto_rstudio_gitlab/images/push.png) + +![push2](documents/tuto_rstudio_gitlab/images/push2.png) + +![push3](documents/tuto_rstudio_gitlab/images/push3.png) + +- NB : Il n'est pas possible de synchroniser vers Gitlab si des modifications ont été faites sur Gitlab et n'ont pas été répercupées en local + +![push4](documents/tuto_rstudio_gitlab/images/push4.png) + +- Cliquer sur "pull" pour synchroniser Gitlab vers Git \ No newline at end of file diff --git a/mooc-rr-2020.Rproj b/mooc-rr-2020.Rproj new file mode 100644 index 0000000000000000000000000000000000000000..8e3c2ebc99e2e337f7d69948b93529a437590b27 --- /dev/null +++ b/mooc-rr-2020.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX