Skip to content

Commit dcbb588

Browse files
committed
varia
1 parent ecbd365 commit dcbb588

File tree

5 files changed

+174
-135
lines changed

5 files changed

+174
-135
lines changed

img/app-ai-ml-chatgpt.png

21 KB
Loading

img/app-pao-markdown-obsidian-ex1.png

183 KB
Loading

teach/stats/r4a/2025/index-part1.qmd

+72-36
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,17 @@ A <img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-
153153

154154
Copy/paste can be done over numerous code-oriented platforms without losing the typesetting (easy-to-write plain text syntax):
155155

156-
* <img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-pao-markdown-obsidian.png' style='height: 450px;'>
156+
* [Obsidian](https://obsidian.md/) <img src="https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-pao-markdown-obsidian.png" style="height: 45px;vertical-align: middle;"/>
157+
<img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-pao-markdown-obsidian-ex1.png' style='height: 450px;'>
157158

158-
* <img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-pao-markdown-ex-arches-forum.png' style='height: 450px;'>
159+
* [Discourse](https://www.reddit.com/) <img src="https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-com-discourse.png" style="height: 45px;vertical-align: middle;"/>
160+
<img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-pao-markdown-ex-arches-forum.png' style='height: 450px;'>
159161

160-
* <img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-pao-markdown-ex-github-readme.png' style='height: 450px;'>
162+
* [GitHub]() <img src="https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-github-2.png" style="height: 45px;vertical-align: middle;"/>
163+
<img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-pao-markdown-ex-github-readme.png' style='height: 450px;'>
161164

162-
* <img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-pao-markdown-ex-chatgpt.png' style='height: 450px;'>
165+
* [ChatGPT]() <img src="https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-ai-ml-chatgpt.png" style="height: 45px;vertical-align: middle;"/>
166+
<img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-pao-markdown-ex-chatgpt.png' style='height: 450px;'>
163167

164168
\
165169

@@ -495,7 +499,7 @@ Below this text there's a line separator
495499
Text styling can be extended done with <img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-prg-html.png' style='height: 45px;vertical-align: middle;'><img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-prg-css.png' style='height: 45px;vertical-align: middle;'> markup languages
496500

497501
<div class="div-text">
498-
<small>narrative part</small>
502+
<small>narrative part</small><br>
499503
```{.html}
500504
<h2 style="color:blue;">A Blue Heading</h2>
501505
<p style="color:red;">A red paragraph.</p>
@@ -596,13 +600,18 @@ Text styling can be extended done with <img src='https://raw.githubusercontent.c
596600
::::
597601

598602

599-
<br><br> <center> gives the same result : </center> <br>
603+
<br> <center> gives the same result :
604+
605+
<small>
600606

601607
| Header 1 | Header 2 |
602608
| ----------- | ----------- |
603609
| Row 1 | Text |
604610
| Row 2 | Another text|
605611

612+
</small>
613+
</center>
614+
606615
\
607616

608617
### Alignements
@@ -614,54 +623,67 @@ Use `:----:`, `:---`, or `---:` to align
614623
```{.md}
615624
| Left | Center | Right |
616625
| :--- | :----: | ---: |
617-
| Header | Title | Here's this |
618-
| Paragraph | Text | And more |
626+
| Header | Title | Hello |
619627
```
620628
</div>
621629

622630
\
623631

624632
| Left | Center | Right |
625633
|:----------|:------:|------------:|
626-
| Header | Title | Here's this |
627-
| Paragraph | Text | And more |
634+
| Header | Title | Hello |
628635

629636
\
630637

631638
### Complex tables
632639

633-
Complex tables have to be created inside <span class="r-code">code chunks</span>, e.g. [kable()](https://bookdown.org/yihui/rmarkdown-cookbook/kable.html) from {`knitr`} with [kable_styling()](https://cran.r-project.org/web/packages/kableExtra/vignettes/awesome_table_in_html.html) from {`kableExtra`}
640+
To create in <span class="r-code">code chunks</span>
634641

635642
<div class="div-code">
636643
<small>code chunk</small><br>
637-
```{r echo = TRUE}
644+
```{.r}
645+
library(dplyr)
638646
library(kableExtra)
639647
dt <- mtcars[1:5, 1:6]
640648
dtt <- dt %>%
641649
kbl() %>%
642650
kable_paper("hover", full_width = F, font_size = 20)
651+
dtt
643652
```
644653
</div>
645-
646654
```{r echo = FALSE}
655+
library(dplyr)
656+
library(kableExtra)
657+
dt <- mtcars[1:5, 1:6]
658+
dtt <- dt %>%
659+
kbl() %>%
660+
kable_paper("hover", full_width = F, font_size = 20)
647661
dtt
648662
```
649663

664+
650665
<div class="div-code">
651666
<small>code chunk</small><br>
652-
```{r echo=TRUE}
667+
```{.r}
653668
dtt <- dt %>%
654-
kbl(caption = "Recreating booktabs style table") %>%
669+
kbl(caption = "My styled table") %>%
655670
kable_classic(full_width = F, html_font = "Cambria", font_size = 20)
671+
dtt
656672
```
657673
</div>
658-
659-
```{r echo = FALSE}
674+
```{r echo=FALSE}
675+
dtt <- dt %>%
676+
kbl(caption = "Recreating booktabs style table") %>%
677+
kable_classic(full_width = F, html_font = "Cambria", font_size = 20)
660678
dtt
661679
```
662680

663681
\
664682

683+
::: {.callout-note}
684+
[kbl()](https://www.rdocumentation.org/packages/kableExtra/versions/1.4.0/topics/kbl), [kable()](https://bookdown.org/yihui/rmarkdown-cookbook/kable.html), [kable_classic()](https://www.rdocumentation.org/packages/kableExtra/versions/1.4.0/topics/kable_classic) and [kable_styling()](https://cran.r-project.org/web/packages/kableExtra/vignettes/awesome_table_in_html.html) from the {`kableExtra`} package
685+
:::
686+
665687
### Hint
666688

667689
Use a table converter
@@ -715,11 +737,11 @@ Markdown notation
715737
<div class="div-text">
716738
<small>narrative part</small><br>
717739
```{.md }
718-
![](../../../www/logo.png){width=100px}
740+
![](C:/Rprojects/thomashuet/teach/www/logo.png){width=100px}
719741
```
720742
</div>
721743

722-
![](../../../www/logo.png){width=100px}
744+
![](C:/Rprojects/thomashuet/teach/www/logo.png){width=100px}
723745

724746
***
725747

@@ -728,11 +750,11 @@ HTML notation
728750
<div class="div-text">
729751
<small>narrative part</small><br>
730752
```{.md }
731-
<img src="../../../www/logo.png" alt="" width=100>
753+
<img src="C:/Rprojects/thomashuet/teach/www/logo.png" alt="" width=100>
732754
```
733755
</div>
734756

735-
<img src="../../../www/logo.png" alt="" width=100>
757+
<img src="C:/Rprojects/thomashuet/teach/www/logo.png" alt="" width=100>
736758

737759

738760

@@ -752,7 +774,7 @@ Extra spaces (HTML only)
752774

753775
### End of line
754776

755-
End of line (`<br>` in HTML) with 2 or more spaces and return -- or `\` and return -- for example:
777+
In Markdown: 2+ spaces and return, or `\` and return. In HTML: `<br>`
756778

757779

758780
:::: {.columns}
@@ -766,7 +788,7 @@ Reconnais-toi
766788
Cette adorable personne c'est toi
767789
Sous le grand chapeau canotier
768790
Oeil
769-
Nez
791+
Nez
770792
Ta Bouche
771793
Voici l’ovale de ta figure
772794
Ton cou Exquis
@@ -778,7 +800,7 @@ Reconnais-toi
778800
Cette adorable personne c'est toi
779801
Sous le grand chapeau canotier
780802
Oeil
781-
Nez
803+
Nez
782804
Ta Bouche
783805
Voici l’ovale de ta figure
784806
Ton cou Exquis
@@ -970,27 +992,32 @@ Footnotes numbering are automatically updated/incremented
970992

971993
### Variables
972994

973-
Variables calculated inside the <span class="r-code">code chunks</span> can be called in the <span class="r-text">narrative parts</span>: <img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/teach/www/rmd_call_var.png' style='height: 45px;vertical-align: middle;'>
995+
Variables calculated inside the <span class="r-code">code chunks</span> can be called in the <span class="r-text">narrative parts</span>
974996

975997
<div class="div-code">
976998
<small>code chunk</small>
977-
```{r echo=TRUE}
999+
```{.r}
9781000
library(archdata)
9791001
data("Handaxes")
9801002
number.of.axes <- nrow(Handaxes)
9811003
```
9821004
</div>
1005+
```{r echo=FALSE}
1006+
library(archdata)
1007+
data("Handaxes")
1008+
number.of.axes <- nrow(Handaxes)
1009+
```
9831010

9841011
<div class="div-text">
9851012
<small>narrative part</small>
9861013
```{.md}
987-
Furze Platt dataset counts 'r number.of.axes' axes
1014+
<small>Furze Platt dataset counts 'r number.of.axes' axes</small>
9881015
```
9891016
</div>
990-
Furze Platt dataset counts `r number.of.axes` axes
1017+
<small>Furze Platt dataset counts `r number.of.axes` axes</small>
9911018

9921019
::: {.callout-warning}
993-
Here the <notes>`</notes> quote has been changed to a <notes>'</notes> quote for display purpose
1020+
Here the <notes>`</notes> quote has been changed to a <notes>'</notes> quote for display purpose: <img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/teach/www/rmd_call_var.png' style='height: 45px;vertical-align: middle;'>
9941021
:::
9951022
\
9961023

@@ -1002,17 +1029,18 @@ Here the <notes>`</notes> quote has been changed to a <notes>'</notes> quote for
10021029
```{.r}
10031030
{r maxLmaxB, echo=FALSE, fig.align="center", fig.cap= "Axes L/B ratio"}
10041031
```
1005-
</div>
1032+
10061033
```{.r}
10071034
library(archdata)
10081035
data("Handaxes")
10091036
plot(Handaxes$L, Handaxes$B)
10101037
model <- lm(B ~ L, data = Handaxes)
10111038
abline(lm(model))
10121039
```
1040+
</div>
10131041

10141042
```{r maxLmaxB, echo=FALSE, fig.align="center", fig.cap= "Axes L/B ratio"}
1015-
#| out-width: "70%"
1043+
#| out-width: "60%"
10161044
10171045
library(archdata)
10181046
data("Handaxes")
@@ -1023,13 +1051,17 @@ abline(lm(model))
10231051

10241052
<div class="div-text">
10251053
<small>narrative part</small>
1026-
```
1027-
The distribution of the maximum length (L) and maximum breadth (B) shows a R^2^ = `r round(model$coefficients[2], 2)`, Fig. \@ref(fig:maxLmaxB))
1054+
```{.md}
1055+
<small>The distribution of the maximum length (L) and maximum breadth (B) shows a R^2^ = 'r round(model$coefficients[2], 2)', Fig. \@ref(fig:maxLmaxB))</small>
10281056
```
10291057
</div>
1058+
<small>The distribution of the maximum length (L) and maximum breadth (B) shows a R^2^ = `r round(model$coefficients[2], 2)`, Fig. \@ref(fig:maxLmaxB))</small>
1059+
1060+
::: {.callout-warning}
1061+
1062+
* Here the <notes>`</notes> quote has been changed to a <notes>'</notes> quote for display purpose in 'r round(model$coefficients[2], 2)'.
1063+
* Need to use <img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/r-pkg-bookdown.png' style='width: 50px;vertical-align: middle;'> [bookdown](https://bookdown.org/) to render correctly '\@ref(fig:maxLmaxB)', see: the [raw `.Rmd`](https://github.com/zoometh/thomashuet/blob/main/teach/stats/r4a/examples/cross-referencing.Rmd) and the [rendered PDF](https://github.com/zoometh/thomashuet/blob/main/teach/stats/r4a/examples/cross-referencing.pdf)
10301064

1031-
::: {.callout-note}
1032-
Need to use <img src='https://raw.githubusercontent.com/zoometh/thomashuet/master/img/r-pkg-bookdown.png' style='width: 50px;vertical-align: middle;'> [bookdown](https://bookdown.org/), see: the [native `.Rmd`](https://github.com/zoometh/thomashuet/blob/main/teach/stats/r4a/examples/cross-referencing.Rmd) and the [rendered PDF](https://github.com/zoometh/thomashuet/blob/main/teach/stats/r4a/examples/cross-referencing.pdf)
10331065
:::
10341066

10351067

@@ -1108,14 +1140,18 @@ published by Yihui Xie [-@Xie19]
11081140
+---------------------------------------------+-------------------------------------------+
11091141

11101142
::: {.callout-note}
1111-
It's easy to retrieve [this reference in Google Scholar](https://scholar.google.fr/scholar?hl=en&as_sdt=0%2C5&q=Tinytex%3A+A+Lightweight%2C+Cross-Platform%2C+and+Easy-to-Maintain+Latex+Distribution+Based+on+Tex+Live&btnG=), and paste it in the `.bib` file. Remember that you can also use [Visual R Markdown](#vrm) bibliographical references add-on (ex: [Zotero](https://www.zotero.org/) <img src="https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-bib-zotero.png" style="height: 45px;vertical-align: middle;"/>)
1143+
It's easy to retrieve [this reference in Google Scholar](https://scholar.google.fr/scholar?hl=en&as_sdt=0%2C5&q=Tinytex%3A+A+Lightweight%2C+Cross-Platform%2C+and+Easy-to-Maintain+Latex+Distribution+Based+on+Tex+Live&btnG=), and paste it in the `.bib` file. You can also use [Visual R Markdown](#vrm) bibliographical references add-on (ex: [Zotero](https://www.zotero.org/) <img src="https://raw.githubusercontent.com/zoometh/thomashuet/master/img/app-bib-zotero.png" style="height: 45px;vertical-align: middle;"/>)
11121144
:::
11131145

11141146
\
11151147

11161148

11171149
:::
11181150

1151+
## Go to part 2
1152+
1153+
[Here](https://zoometh.github.io/thomashuet/teach/stats/r4a/2025/site/index-part2#/title-slide)
1154+
11191155

11201156

11211157
## References

0 commit comments

Comments
 (0)