Commit 7c1e30ca authored by David Carayon's avatar David Carayon
Browse files

Re-introduced a data analysis project template

parent 20d37465
......@@ -2,3 +2,4 @@
^\.Rproj\.user$
^README\.Rmd$
^LICENSE\.md$
^\.github$
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
name: R-CMD-check
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: rcmdcheck
- uses: r-lib/actions/check-r-package@v1
Package: InraeThemes
Title: Modèles et thèmes INRAE
Version: 2.0.1
Version: 2.1.0
Authors@R:
c(
person(given = "David",
......
......@@ -3,6 +3,7 @@
export(bs_inrae)
export(create_presentation)
export(create_report)
export(new_analysis)
export(palette_inrae)
export(scale_color_inrae)
export(scale_fill_inrae)
......
## InraeThemes 2.1.0
* Re-introduced data analysis project template
## InraeThemes 2.0.1
* Update to latex preambles to better handle YAML metadata
......
#' Architecture type d'une analyse
#' Inpired by `ProjectTemplate`
#'
#' @param projname Name of the project to be created
#' @param init Should a git repository be initialised ?
#'
#' @return a data analysis directory
#' @export
new_analysis <- function(projname = "MyProject",init = TRUE){
# ensure path exists
dir.create(projname, recursive = TRUE, showWarnings = FALSE)
# Creating folders --------------------------------------------------------
dir.create(file.path(projname,"data"))
dir.create(file.path(projname,"cache"))
dir.create(file.path(projname,"scripts"))
dir.create(file.path(projname,"docs"))
dir.create(file.path(projname,"img"))
dir.create(file.path(projname,"R"))
dir.create(file.path(projname,"report"))
# Should git init ? -------------------------------------------------------
if(init) {gert::git_init(projname)}
# Generating TODO ---------------------------------------------------------
file.create(file.path(projname,"TODO.txt"))
sink(file.path(projname,"TODO.txt"))
cat("Welcome!
Project name: N/A
Notes
-----
")
sink()
# Generating a README -----------------------------------------------------
file.create(file.path(projname,"README.md"))
sink(file.path(projname,"README.md"))
cat("> Welcome to Your project !
Description of the project's architecture :
- `README.md` : The intro file is used to provide project orientation. The file defines project objectives and is intended to introduce project data, source code and configurations for repeatable research. The md file format is that of a basic text or markdown file. When saved to GitHub, it will be used to create an HTML project wiki.
- `TODO.txt` : A note file on a project's development or implementation status with a list of bugs and future improvement needs.
- `cache` : The cache is used to store data output.
- `data` : The data directory stores all data inputs in raw format.
- `docs` : Here you can store any source or reference material about the project.
- `img` : Used to store image output, including Rplots, image files or gif animations.
- `R` : R source code (Plain R files or Rmd/Qmd notebooks)
- `report` : Used to store output tables and reports. R is capable of supporting a broad range of outputs including Word, Powerpoint, pdf, LaTeX and HTML.
- `scripts` : Scripts other than R (SQL, python...)")
sink()
# Generating an Rmd notebook ---------------------------------------------------
file.create(file.path(projname,"R","01_notebook.Rmd"))
sink(file.path(projname,"R","01_notebook.Rmd"))
cat("---
title: \"Titre de l'analyse\"
subtitle : \"Sous titre\"
author: \"Auteur\"
date: \"Derni\u00e8re M.A.J : `r format(Sys.time(), '%d %B, %Y')`\"
output:
html_notebook:
toc: true
toc_float:
collapsed: false
smooth_scroll: true
toc_depth: 3
number_sections: true
---
# Intro
# Conclusion
Pour conclure :
# R session info {-}
Pensez \u00e0 inclure cette section afin d'indiquer l'\u00e9tat de votre machine lorsque vous avez r\u00e9alis\u00e9 cette analyse.
```{r session info}
xfun::session_info()
```
# References {-}
")
sink()
# Generating a Qmd notebook ---------------------------------------------------
file.create(file.path(projname,"R","01_notebook.qmd"))
sink(file.path(projname,"R","01_notebook.qmd"))
cat("---
title: \"Titre\"
subtitle: \"Sous-titre\"
author: \"Auteur du document\"
date: \"`r lubridate::today()`\"
license: \"Open Licence (Etalab)\"
toc: true
format:
html:
code-overflow: wrap
theme: lumen
number-sections: true
highlight-style: github
html-math-method: katex
code-fold: show
code-tools: true
self-contained: true
execute:
warning: false
message: false
out.width: \"100%\"
df_print: kable
editor_options:
chunk_output_type: console
---
# Intro
# Conclusion
Pour conclure :
# R session info {-}
Pensez \u00e0 inclure cette section afin d'indiquer l'\u00e9tat de votre machine lorsque vous avez r\u00e9alis\u00e9 cette analyse.
```{r session info}
xfun::session_info()
```
# References {-}
")
sink()
}
......@@ -6,3 +6,10 @@
"example_datasets"
#' Jeu de couleurs INRAE
#'
#' Cet objet contient les couleurs INRAE
#'
#' @format un vecteur R
"couleurs_inrae"
......@@ -20,9 +20,9 @@ library(magrittr)
<!-- badges: start -->
[![Lifecycle:experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![packageversion](https://img.shields.io/badge/Package%20version-2.0.1-green?style=flat-square)](commits/master)
[![packageversion](https://img.shields.io/badge/Package%20version-2.1.0-green?style=flat-square)](commits/master)
[![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![R-CMD-check](https://github.com/davidcarayon/InraeThemes/workflows/R-CMD-check/badge.svg)](https://github.com/davidcarayon/InraeThemes/actions)
<!-- badges: end -->
InraeThemes est une collection non officielle de templates, thèmes et autres éléments graphiques basés sur des formats en lien avec R et en accords avec la charte graphique INRAE.
......@@ -78,6 +78,7 @@ InraeThemes propose ces éléments :
- Un template de rapport basé sur la classe `book` de Quarto et proposant 3 formats de sortie : HTML, PDF et DOCX
- Deux templates de présentation et de rapports au format Rmarkdown
- Un template de carte de visite au format Rmarkdown
- Un template de projet Rstudio suivant un certain nombre de "bonnes pratiques"
## Palette de couleurs
......@@ -227,6 +228,20 @@ Ces deux templates sont accessibles via l'interface de création de documents Rm
Une carte de visite, basée sur {pagedown}, avec logo INRAE peut-être produite en plusieurs exemplaires par page (nombre paramétrable) via l'interface de création de documents Rmarkdown sous Rstudio.
# Création d'un répertoire d'analyse
Nous proposons dans ce package un template de projet pour l'analyse de
données, librement inspiré du package
[{ProjectTemplate}](https://cran.r-project.org/web/packages/ProjectTemplate/)
Ce template est directement accessible dans Rstudio via
`Projects > New Project > New Directory > Data Analysis Project`.
L'utilisateur peut ici définir la localisation de son projet et choisir
d'initialiser ou non un dépôt git.
> Note : Cette architecture n'est qu'un exemple de bonne pratiques
> parmis bien d'autres. Libre à l'utilisateur de modifier ce template selon ses habitudes. Vos suggestions d'améliorations sont évidemment les
> bienvenues [ici](https://github.com/davidcarayon/InraeThemes/issues).
# Work in Progress / TO-DO
* Convertir les templates de projet Quarto en templates de documents sous Rstudio lorsque ce sera disponible (juillet 2022)
......
......@@ -6,9 +6,9 @@
<!-- badges: start -->
[![Lifecycle:experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![packageversion](https://img.shields.io/badge/Package%20version-2.0.1-green?style=flat-square)](commits/master)
[![packageversion](https://img.shields.io/badge/Package%20version-2.1.0-green?style=flat-square)](commits/master)
[![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![R-CMD-check](https://github.com/davidcarayon/InraeThemes/workflows/R-CMD-check/badge.svg)](https://github.com/davidcarayon/InraeThemes/actions)
<!-- badges: end -->
InraeThemes est une collection non officielle de templates, thèmes et
......@@ -81,6 +81,8 @@ InraeThemes propose ces éléments :
proposant 3 formats de sortie : HTML, PDF et DOCX
- Deux templates de présentation et de rapports au format Rmarkdown
- Un template de carte de visite au format Rmarkdown
- Un template de projet Rstudio suivant un certain nombre de “bonnes
pratiques”
## Palette de couleurs
......@@ -289,6 +291,22 @@ Une carte de visite, basée sur {pagedown}, avec logo INRAE peut-être
produite en plusieurs exemplaires par page (nombre paramétrable) via
l’interface de création de documents Rmarkdown sous Rstudio.
# Création d’un répertoire d’analyse
Nous proposons dans ce package un template de projet pour l’analyse de
données, librement inspiré du package
[{ProjectTemplate}](https://cran.r-project.org/web/packages/ProjectTemplate/)
Ce template est directement accessible dans Rstudio via
`Projects > New Project > New Directory > Data Analysis Project`.
L’utilisateur peut ici définir la localisation de son projet et choisir
d’initialiser ou non un dépôt git.
> Note : Cette architecture n’est qu’un exemple de bonne pratiques
> parmis bien d’autres. Libre à l’utilisateur de modifier ce template
> selon ses habitudes. Vos suggestions d’améliorations sont évidemment
> les bienvenues
> [ici](https://github.com/davidcarayon/InraeThemes/issues).
# Work in Progress / TO-DO
- Convertir les templates de projet Quarto en templates de documents
......
{
"hash": "15a9db8756dd05c54879460c4eb647e1",
"result": {
"markdown": "# Preface {.unnumbered}\n\nThis is a Quarto book. \n\nTo learn more about Quarto books visit <https://quarto.org/docs/books>.\n\n::: {.cell}\n\n```{.r .cell-code}\n1 + 1\n```\n\n::: {.cell-output-stdout}\n```\n[1] 2\n```\n:::\n:::\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {},
"engineDependencies": {
"knitr": [
"{\"type\":\"list\",\"attributes\":{},\"value\":[]}"
]
},
"preserve": null,
"postProcess": false
}
}
\ No newline at end of file
{
"hash": "15a9db8756dd05c54879460c4eb647e1",
"result": {
"markdown": "# Preface {.unnumbered}\n\nThis is a Quarto book. \n\nTo learn more about Quarto books visit <https://quarto.org/docs/books>.\n\n::: {.cell}\n\n```{.r .cell-code}\n1 + 1\n```\n\n::: {.cell-output-stdout}\n```\n[1] 2\n```\n:::\n:::\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": [],
"engineDependencies": {},
"preserve": {},
"postProcess": null
}
}
\ No newline at end of file
{
"hash": "15a9db8756dd05c54879460c4eb647e1",
"result": {
"markdown": "# Preface {.unnumbered}\n\nThis is a Quarto book. \n\nTo learn more about Quarto books visit <https://quarto.org/docs/books>.\n\n::: {.cell}\n\n```{.r .cell-code}\n1 + 1\n```\n\n::: {.cell-output-stdout}\n```\n[1] 2\n```\n:::\n:::\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {},
"engineDependencies": {
"knitr": [
"{\"type\":\"list\",\"attributes\":{},\"value\":[]}"
]
},
"preserve": null,
"postProcess": false
}
}
\ No newline at end of file
{
"hash": "f0224ce2595094f86e2c42e4fb49530b",
"result": {
"markdown": "# Introduction\n\nThis is a book created from markdown and executable code.\n\nSee @knuth84 for additional discussion of literate programming.\n\n::: {.cell}\n\n```{.r .cell-code}\n1 + 1\n```\n\n::: {.cell-output-stdout}\n```\n[1] 2\n```\n:::\n:::\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {},
"engineDependencies": {
"knitr": [
"{\"type\":\"list\",\"attributes\":{},\"value\":[]}"
]
},
"preserve": null,
"postProcess": false
}
}
\ No newline at end of file
{
"hash": "f0224ce2595094f86e2c42e4fb49530b",
"result": {
"markdown": "# Introduction\n\nThis is a book created from markdown and executable code.\n\nSee @knuth84 for additional discussion of literate programming.\n\n::: {.cell}\n\n```{.r .cell-code}\n1 + 1\n```\n\n::: {.cell-output-stdout}\n```\n[1] 2\n```\n:::\n:::\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": [],
"engineDependencies": {},
"preserve": {},
"postProcess": null
}
}
\ No newline at end of file
{
"hash": "f0224ce2595094f86e2c42e4fb49530b",
"result": {
"markdown": "# Introduction\n\nThis is a book created from markdown and executable code.\n\nSee @knuth84 for additional discussion of literate programming.\n\n::: {.cell}\n\n```{.r .cell-code}\n1 + 1\n```\n\n::: {.cell-output-stdout}\n```\n[1] 2\n```\n:::\n:::\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {},
"engineDependencies": {
"knitr": [
"{\"type\":\"list\",\"attributes\":{},\"value\":[]}"
]
},
"preserve": null,
"postProcess": false
}
}
\ No newline at end of file
/*!
* clipboard.js v2.0.10
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return o}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),c=n.n(e);function a(t){try{return document.execCommand(t)}catch(t){return}}var f=function(t){t=c()(t);return a("cut"),t};var l=function(t){var e,n,o,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body},i="";return"string"==typeof t?(e=t,n="rtl"===document.documentElement.getAttribute("dir"),(o=document.createElement("textarea")).style.fontSize="12pt",o.style.border="0",o.style.padding="0",o.style.margin="0",o.style.position="absolute",o.style[n?"right":"left"]="-9999px",n=window.pageYOffset||document.documentElement.scrollTop,o.style.top="".concat(n,"px"),o.setAttribute("readonly",""),o.value=e,o=o,r.container.appendChild(o),i=c()(o),a("copy"),o.remove()):(i=c()(t),a("copy")),i};function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,o=t.container,e=t.target,t=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==e){if(!e||"object"!==r(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return t?l(t,{container:o}):e?"cut"===n?f(e):l(e,{container:o}):void 0};function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=m(n);return t=o?(t=m(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments),e=this,!(t=t)||"object"!==p(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}}function m(t){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e){t="data-clipboard-".concat(t);if(e.hasAttribute(t))return e.getAttribute(t)}var o=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(r,i());var t,e,n,o=h(r);function r(t,e){var n;return function(t){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this),(n=o.call(this)).resolveOptions(e),n.listenClick(t),n}return t=r,n=[{key:"copy",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body};return l(t,e)}},{key:"cut",value:function(t){return f(t)}},{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof t?[t]:t,e=!!document.queryCommandSupported;return t.forEach(function(t){e=e&&!!document.queryCommandSupported(t)}),e}}],(e=[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=u()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",t=s({action:n,container:this.container,target:this.target(e),text:this.text(e)});this.emit(t?"success":"error",{action:n,text:t,trigger:e,clearSelection:function(){e&&e.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(t){return v("action",t)}},{key:"defaultTarget",value:function(t){t=v("target",t);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(t){return v("text",t)}},{key:"destroy",value:function(){this.listener.destroy()}}])&&d(t.prototype,e),n&&d(t,n),r}()},828:function(t){var e;"undefined"==typeof Element||Element.prototype.matches||((e=Element.prototype).matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector),t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:function(t,e,n){var u=n(828);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=u(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},879:function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:function(t,e,n){var f=n(879),l=n(438);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!f.string(e))throw new TypeError("Second argument must be a String");if(!f.fn(n))throw new TypeError("Third argument must be a Function");if(f.node(t))return c=e,a=n,(u=t).addEventListener(c,a),{destroy:function(){u.removeEventListener(c,a)}};if(f.nodeList(t))return o=t,r=e,i=n,Array.prototype.forEach.call(o,function(t){t.addEventListener(r,i)}),{destroy:function(){Array.prototype.forEach.call(o,function(t){t.removeEventListener(r,i)})}};if(f.string(t))return t=t,e=e,n=n,l(document.body,t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,u,c,a}},817:function(t){t.exports=function(t){var e,n="SELECT"===t.nodeName?(t.focus(),t.value):"INPUT"===t.nodeName||"TEXTAREA"===t.nodeName?((e=t.hasAttribute("readonly"))||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),e||t.removeAttribute("readonly"),t.value):(t.hasAttribute("contenteditable")&&t.focus(),n=window.getSelection(),(e=document.createRange()).selectNodeContents(t),n.removeAllRanges(),n.addRange(e),n.toString());return n}},279:function(t){function e(){}e.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,u=o.length;i<u;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=e,t.exports.TinyEmitter=e}},r={},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o(686).default;function o(t){if(r[t])return r[t].exports;var e=r[t]={exports:{}};return n[t](e,e.exports,o),e.exports}var n,r});
\ No newline at end of file
{
"hash": "995687c56ae32f023cd967bab3a0dc0f",
"result": {
"markdown": "# Summary\n\nIn summary, this book has no content whatsoever.\n\n::: {.cell}\n\n```{.r .cell-code}\n1 + 1\n```\n\n::: {.cell-output-stdout}\n```\n[1] 2\n```\n:::\n:::\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(InraeThemes)\nlibrary(ggplot2)\n\ndata(\"example_datasets\")\n\nggplot(example_datasets$cars, aes(x = mpg, fill = cyl,colour = cyl)) +\n geom_density(alpha = 0.75) +\n scale_fill_inrae() +\n scale_color_inrae() +\n labs(fill = \"Cylinders\", colour = \"Cylinders\", x = \"MPG\", y = \"Density\") +\n theme_inrae(base_family = \"\")\n```\n\n::: {.cell-output-display}\n![](summary_files/figure-docx/unnamed-chunk-4-1.png)\n:::\n:::\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?",
"supporting": [
"summary_files/figure-docx"
],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {},
"engineDependencies": {
"knitr": [
"{\"type\":\"list\",\"attributes\":{},\"value\":[]}"
]
},
"preserve": null,
"postProcess": false
}
}
\ No newline at end of file
{
"hash": "995687c56ae32f023cd967bab3a0dc0f",
"result": {
"markdown": "# Summary\n\nIn summary, this book has no content whatsoever.\n\n::: {.cell}\n\n```{.r .cell-code}\n1 + 1\n```\n\n::: {.cell-output-stdout}\n```\n[1] 2\n```\n:::\n:::\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(InraeThemes)\nlibrary(ggplot2)\n\ndata(\"example_datasets\")\n\nggplot(example_datasets$cars, aes(x = mpg, fill = cyl,colour = cyl)) +\n geom_density(alpha = 0.75) +\n scale_fill_inrae() +\n scale_color_inrae() +\n labs(fill = \"Cylinders\", colour = \"Cylinders\", x = \"MPG\", y = \"Density\") +\n theme_inrae(base_family = \"\")\n```\n\n::: {.cell-output-display}\n![](summary_files/figure-html/unnamed-chunk-4-1.png){width=672}\n:::\n:::\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?",
"supporting": [
"summary_files/figure-html"
],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": [],
"engineDependencies": {},
"preserve": {},
"postProcess": null
}
}
\ No newline at end of file
{
"hash": "995687c56ae32f023cd967bab3a0dc0f",
"result": {
"markdown": "# Summary\n\nIn summary, this book has no content whatsoever.\n\n::: {.cell}\n\n```{.r .cell-code}\n1 + 1\n```\n\n::: {.cell-output-stdout}\n```\n[1] 2\n```\n:::\n:::\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(InraeThemes)\nlibrary(ggplot2)\n\ndata(\"example_datasets\")\n\nggplot(example_datasets$cars, aes(x = mpg, fill = cyl,colour = cyl)) +\n geom_density(alpha = 0.75) +\n scale_fill_inrae() +\n scale_color_inrae() +\n labs(fill = \"Cylinders\", colour = \"Cylinders\", x = \"MPG\", y = \"Density\") +\n theme_inrae(base_family = \"\")\n```\n\n::: {.cell-output-display}\n![](summary_files/figure-pdf/unnamed-chunk-4-1.pdf){fig-pos='H'}\n:::\n:::\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?",
"supporting": [
"summary_files/figure-pdf"
],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {},
"engineDependencies": {
"knitr": [
"{\"type\":\"list\",\"attributes\":{},\"value\":[]}"
]
},
"preserve": null,
"postProcess": false
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment