|
- <!DOCTYPE html>
- <html lang="" xml:lang="">
- <head>
- <title>Données tabulaires</title>
- <meta charset="utf-8" />
- <meta name="author" content="Maxime Wack" />
- <script src="libs/header-attrs-2.1/header-attrs.js"></script>
- <link href="libs/remark-css-0.0.1/default.css" rel="stylesheet" />
- <script src="libs/htmlwidgets-1.5.1/htmlwidgets.js"></script>
- <script src="libs/jquery-1.12.4/jquery.min.js"></script>
- <link href="libs/datatables-css-0.0.0/datatables-crosstalk.css" rel="stylesheet" />
- <script src="libs/datatables-binding-0.13/datatables.js"></script>
- <link href="libs/dt-core-1.10.20/css/jquery.dataTables.min.css" rel="stylesheet" />
- <link href="libs/dt-core-1.10.20/css/jquery.dataTables.extra.css" rel="stylesheet" />
- <script src="libs/dt-core-1.10.20/js/jquery.dataTables.min.js"></script>
- <link href="libs/crosstalk-1.1.0.1/css/crosstalk.css" rel="stylesheet" />
- <script src="libs/crosstalk-1.1.0.1/js/crosstalk.min.js"></script>
- <link rel="stylesheet" href="css/my_style.css" type="text/css" />
- </head>
- <body>
- <textarea id="source">
-
-
-
-
- class: center, middle, title
-
- # UE Visualisation
-
- ### 2020-2021
-
- ## Dr. Maxime Wack
-
- ### AHU Informatique médicale
- #### Hôpital Européen Georges Pompidou, </br> Université de Paris
-
- ---
-
- # Données tabulaires
-
- .center[Chargement des données avec `read_csv`]
-
-
- ```r
- read_csv("lab03-data/notes.csv") -> notes
- ```
-
- <div id="htmlwidget-f5059698d71e2c376fcf" style="width:100%;height:auto;" class="datatables html-widget"></div>
- <script type="application/json" data-for="htmlwidget-f5059698d71e2c376fcf">{"x":{"filter":"none","data":[["1/1/2019","1/15/2019","2/1/2019","2/15/2019","3/1/2019","3/15/2019","4/1/2019","4/15/2019","5/1/2019","5/15/2019"],[14,16,15,17,14,15,13,15,16,17],[10,11,11,10,15,13,12,12,13,11],[18,19,18,19,19,20,19,19,17,18],[9,10,12,11,14,13,14,15,14,15]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th>Date<\/th>\n <th>Alice<\/th>\n <th>Bob<\/th>\n <th>Claire<\/th>\n <th>David<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"paging":false,"info":false,"searching":false,"columnDefs":[{"className":"dt-right","targets":[1,2,3,4]}],"order":[],"autoWidth":false,"orderClasses":false}},"evals":[],"jsHooks":[]}</script>
-
- ---
-
- # Pivot
-
- .center[Données *wide* → *long*]
-
-
- ```r
- pivot_longer(notes,
- Alice:David,
- names_to = "Prénom",
- values_to = "Note") -> notes_long
- ```
-
- <div id="htmlwidget-d3acf82e5da55982884c" style="width:100%;height:auto;" class="datatables html-widget"></div>
- <script type="application/json" data-for="htmlwidget-d3acf82e5da55982884c">{"x":{"filter":"none","data":[["1/1/2019","1/1/2019","1/1/2019","1/1/2019","1/15/2019","1/15/2019","1/15/2019","1/15/2019","2/1/2019","2/1/2019","2/1/2019","2/1/2019","2/15/2019","2/15/2019","2/15/2019","2/15/2019","3/1/2019","3/1/2019","3/1/2019","3/1/2019","3/15/2019","3/15/2019","3/15/2019","3/15/2019","4/1/2019","4/1/2019","4/1/2019","4/1/2019","4/15/2019","4/15/2019","4/15/2019","4/15/2019","5/1/2019","5/1/2019","5/1/2019","5/1/2019","5/15/2019","5/15/2019","5/15/2019","5/15/2019"],["Alice","Bob","Claire","David","Alice","Bob","Claire","David","Alice","Bob","Claire","David","Alice","Bob","Claire","David","Alice","Bob","Claire","David","Alice","Bob","Claire","David","Alice","Bob","Claire","David","Alice","Bob","Claire","David","Alice","Bob","Claire","David","Alice","Bob","Claire","David"],[14,10,18,9,16,11,19,10,15,11,18,12,17,10,19,11,14,15,19,14,15,13,20,13,13,12,19,14,15,12,19,15,16,13,17,14,17,11,18,15]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th>Date<\/th>\n <th>Prénom<\/th>\n <th>Note<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"paging":false,"info":false,"searching":false,"columnDefs":[{"className":"dt-right","targets":2}],"order":[],"autoWidth":false,"orderClasses":false}},"evals":[],"jsHooks":[]}</script>
-
- ---
-
- # Pivot
-
- .center[Données *long* → *wide*]
-
-
- ```r
- pivot_wider(notes_long,
- names_from = Prénom,
- values_from = Note)
- ```
-
- <div id="htmlwidget-75b346f1165091af2cbb" style="width:100%;height:auto;" class="datatables html-widget"></div>
- <script type="application/json" data-for="htmlwidget-75b346f1165091af2cbb">{"x":{"filter":"none","data":[["1/1/2019","1/15/2019","2/1/2019","2/15/2019","3/1/2019","3/15/2019","4/1/2019","4/15/2019","5/1/2019","5/15/2019"],[14,16,15,17,14,15,13,15,16,17],[10,11,11,10,15,13,12,12,13,11],[18,19,18,19,19,20,19,19,17,18],[9,10,12,11,14,13,14,15,14,15]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th>Date<\/th>\n <th>Alice<\/th>\n <th>Bob<\/th>\n <th>Claire<\/th>\n <th>David<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"paging":false,"info":false,"searching":false,"columnDefs":[{"className":"dt-right","targets":[1,2,3,4]}],"order":[],"autoWidth":false,"orderClasses":false}},"evals":[],"jsHooks":[]}</script>
-
- ---
-
- # Exercices
-
- Utiliser les fonctions de `pivot_*` pour exprimer le dataset `gapminder` de différentes manières.
-
- ### Représenter l'intégralité sous forme clé-valeur
-
- Chaque ligne ne doit porter qu'une valeur de `lifeExp`, `gdpPercap` ou `pop`, pour chaque pays et chaque année.
-
- ### Représenter un pays par ligne
-
- Une seule ligne par pays, toutes les années × indicateur doivent donner lieu à une nouvelle colonne
-
- ### Reformer gapminder à partir du précédent exercice
- </textarea>
- <style data-target="print-only">@media screen {.remark-slide-container{display:block;}.remark-slide-scaler{box-shadow:none;}}</style>
- <script src="https://remarkjs.com/downloads/remark-latest.min.js"></script>
- <script src="addons/macros.js"></script>
- <script>var slideshow = remark.create({
- "ratio": "4:3",
- "countIncrementalSlides": false,
- "self-contained": true,
- "highlightLines": true
- });
- if (window.HTMLWidgets) slideshow.on('afterShowSlide', function (slide) {
- window.dispatchEvent(new Event('resize'));
- });
- (function(d) {
- var s = d.createElement("style"), r = d.querySelector(".remark-slide-scaler");
- if (!r) return;
- s.type = "text/css"; s.innerHTML = "@page {size: " + r.style.width + " " + r.style.height +"; }";
- d.head.appendChild(s);
- })(document);
-
- (function(d) {
- var el = d.getElementsByClassName("remark-slides-area");
- if (!el) return;
- var slide, slides = slideshow.getSlides(), els = el[0].children;
- for (var i = 1; i < slides.length; i++) {
- slide = slides[i];
- if (slide.properties.continued === "true" || slide.properties.count === "false") {
- els[i - 1].className += ' has-continuation';
- }
- }
- var s = d.createElement("style");
- s.type = "text/css"; s.innerHTML = "@media print { .has-continuation { display: none; } }";
- d.head.appendChild(s);
- })(document);
- // delete the temporary CSS (for displaying all slides initially) when the user
- // starts to view slides
- (function() {
- var deleted = false;
- slideshow.on('beforeShowSlide', function(slide) {
- if (deleted) return;
- var sheets = document.styleSheets, node;
- for (var i = 0; i < sheets.length; i++) {
- node = sheets[i].ownerNode;
- if (node.dataset["target"] !== "print-only") continue;
- node.parentNode.removeChild(node);
- }
- deleted = true;
- });
- })();
- (function() {
- "use strict"
- // Replace <script> tags in slides area to make them executable
- var scripts = document.querySelectorAll(
- '.remark-slides-area .remark-slide-container script'
- );
- if (!scripts.length) return;
- for (var i = 0; i < scripts.length; i++) {
- var s = document.createElement('script');
- var code = document.createTextNode(scripts[i].textContent);
- s.appendChild(code);
- var scriptAttrs = scripts[i].attributes;
- for (var j = 0; j < scriptAttrs.length; j++) {
- s.setAttribute(scriptAttrs[j].name, scriptAttrs[j].value);
- }
- scripts[i].parentElement.replaceChild(s, scripts[i]);
- }
- })();
- (function() {
- var links = document.getElementsByTagName('a');
- for (var i = 0; i < links.length; i++) {
- if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) {
- links[i].target = '_blank';
- }
- }
- })();
- // adds .remark-code-has-line-highlighted class to <pre> parent elements
- // of code chunks containing highlighted lines with class .remark-code-line-highlighted
- (function(d) {
- const hlines = d.querySelectorAll('.remark-code-line-highlighted');
- const preParents = [];
- const findPreParent = function(line, p = 0) {
- if (p > 1) return null; // traverse up no further than grandparent
- const el = line.parentElement;
- return el.tagName === "PRE" ? el : findPreParent(el, ++p);
- };
-
- for (let line of hlines) {
- let pre = findPreParent(line);
- if (pre && !preParents.includes(pre)) preParents.push(pre);
- }
- preParents.forEach(p => p.classList.add("remark-code-has-line-highlighted"));
- })(document);</script>
-
- <script>
- slideshow._releaseMath = function(el) {
- var i, text, code, codes = el.getElementsByTagName('code');
- for (i = 0; i < codes.length;) {
- code = codes[i];
- if (code.parentNode.tagName !== 'PRE' && code.childElementCount === 0) {
- text = code.textContent;
- if (/^\\\((.|\s)+\\\)$/.test(text) || /^\\\[(.|\s)+\\\]$/.test(text) ||
- /^\$\$(.|\s)+\$\$$/.test(text) ||
- /^\\begin\{([^}]+)\}(.|\s)+\\end\{[^}]+\}$/.test(text)) {
- code.outerHTML = code.innerHTML; // remove <code></code>
- continue;
- }
- }
- i++;
- }
- };
- slideshow._releaseMath(document);
- </script>
- <!-- dynamically load mathjax for compatibility with self-contained -->
- <script>
- (function () {
- var script = document.createElement('script');
- script.type = 'text/javascript';
- script.src = 'https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML';
- if (location.protocol !== 'file:' && /^https?:/.test(script.src))
- script.src = script.src.replace(/^https?:/, '');
- document.getElementsByTagName('head')[0].appendChild(script);
- })();
- </script>
- </body>
- </html>
|