<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>R Markdown | Thought splinters</title>
    <link>https://notes.peter-baumgartner.net/tag/r-markdown/</link>
      <atom:link href="https://notes.peter-baumgartner.net/tag/r-markdown/index.xml" rel="self" type="application/rss+xml" />
    <description>R Markdown</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>CC BY-SA 4.0</copyright><lastBuildDate>Sun, 01 Aug 2021 00:00:00 +0000</lastBuildDate>
    <image>
      <url>https://notes.peter-baumgartner.net/media/icon_huab1e86cf5cbc1139acf672dc60b9d7d0_5213_512x512_fill_lanczos_center_2.png</url>
      <title>R Markdown</title>
      <link>https://notes.peter-baumgartner.net/tag/r-markdown/</link>
    </image>
    
    <item>
      <title>Using GitHub as a Mentoring Tool</title>
      <link>https://notes.peter-baumgartner.net/2021/08/01/using-github-as-a-mentoring-tool/</link>
      <pubDate>Sun, 01 Aug 2021 00:00:00 +0000</pubDate>
      <guid>https://notes.peter-baumgartner.net/2021/08/01/using-github-as-a-mentoring-tool/</guid>
      <description>&lt;script src=&#34;https://notes.peter-baumgartner.net/2021/08/01/using-github-as-a-mentoring-tool/index.en_files/kePrint/kePrint.js&#34;&gt;&lt;/script&gt;
&lt;link href=&#34;https://notes.peter-baumgartner.net/2021/08/01/using-github-as-a-mentoring-tool/index.en_files/lightable/lightable.css&#34; rel=&#34;stylesheet&#34; /&gt;



&lt;h2 id=&#34;beginner-intermediate-and-expert-level&#34;&gt;Beginner, Intermediate, and Expert Level&lt;a href=&#34;#beginner-intermediate-and-expert-level&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;For several years I am interested to learn &lt;a href=&#34;https://www.r-project.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;R&lt;/a&gt;, the free software environment for statistical computing and graphics. After&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;reading several books,&lt;/li&gt;
&lt;li&gt;finished some (paid) introductory (MOOC) courses successfully with Coursera&lt;/li&gt;
&lt;li&gt;and especially some smaller (paid) projects&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I would say that I am now (stuck?) on an intermediate skill level. I believe that this is the most challenging step in progressing to an expert for a self-determined learner. There are always so many different avenues to follow up. This is especially true with R and its&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ever increasing amount of new R packages (To date: 20010 (&lt;a href=&#34;https://mran.revolutionanalytics.com/packages&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MRAN&lt;/a&gt;) resp. 17954 (&lt;a href=&#34;https://cran.r-project.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;CRAN&lt;/a&gt;), 3452 (&lt;a href=&#34;https://bioconductor.org/packages/release/BiocViews.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Bioconductor&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;hundreds of books (see: the &lt;a href=&#34;https://www.r-project.org/doc/bib/R-jabref.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;searchable list on r-project.org&lt;/a&gt;, a &lt;a href=&#34;https://github.com/RomanTsegelskyi/rbooks&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;curated list on GitHub&lt;/a&gt; by Roman Tselgelskyi, but also my &lt;a href=&#34;https://wakelet.com/wake/d9cea021-06a5-406b-9b12-e7efd97ad144&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Wakelet on free R Books&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;an unknown number of (free) online tutorials (see the &lt;a href=&#34;https://pairach.com/2012/06/17/r_tutorials_non-uni/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;general list&lt;/a&gt; and &lt;a href=&#34;https://pairach.com/2012/06/17/r_tutorials_non-uni/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;university listed&lt;/a&gt; free R tutorials by Pairach Piboonrungroj and my &lt;a href=&#34;https://wakelet.com/wake/83de9b9e-63d6-46a2-a30e-3f4bec621ce2&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Wakelet on learn R programming&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Comparing my skill level with the three learner paths suggested by RStudio Education, I could affirm my personal assessment. From the six tasks proposals on the intermediate path&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;grab some &lt;a href=&#34;https://www.rstudio.com/resources/cheatsheets/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;R cheat sheets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;learn to get help (see, for instance, my activities on &lt;a href=&#34;https://stackoverflow.com/users/7322615/petzi&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;StackOverflow&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;improve your visualizations&lt;/li&gt;
&lt;li&gt;develop interactive applications with &lt;a href=&#34;https://www.htmlwidgets.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;htmlwidgets&lt;/a&gt; and &lt;a href=&#34;https://shiny.rstudio.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Shiny&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;simplify your model explorations with &lt;a href=&#34;https://www.tidymodels.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;tidymodels&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;explore other specialized packages&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I have some skills with the first three, and I also experimented already with Shiny. I even had worked on some steps at the expert levels by writing an R package: (&lt;a href=&#34;https://github.com/petzi53/bib2academic&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;bib2academic&lt;/a&gt; got 16 stars, but I did not manage to submit it to &lt;a href=&#34;https://cran.r-project.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;CRAN&lt;/a&gt;. It is now obsolete as a similar function was integrated into the Academic Hugo website (now &lt;a href=&#34;https://wowchemy.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Wowchemy&lt;/a&gt; website builder).&lt;/p&gt;



&lt;h2 id=&#34;project-for-motivation-necessary&#34;&gt;Project for Motivation Necessary&lt;a href=&#34;#project-for-motivation-necessary&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;But to continue this path, I would need some strong motivation. I tried, for instance, to read the (not yet finished) book &lt;a href=&#34;https://mastering-shiny.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Mastering Shiny&lt;/a&gt;. As with all books and papers by Hadley Wickham, it is well written and exciting. But to learn continuously, I would need a practical project where I get not only real-world challenges but also a strong personal motivation to complete the product. In finishing the project/product, I would have to learn to overcome several real-world challenges where I would need to look for help and consult/experiment with several new functions or packages.&lt;/p&gt;
&lt;p&gt;But this strategy has two advantages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is very laborious as the specific questions are not (yet) clear enough. Fora like &lt;a href=&#34;https://stackoverflow.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;StackOverflow&lt;/a&gt; are not suitable as the problem space is not delimited, a concrete coding question with a &lt;a href=&#34;https://community.rstudio.com/t/faq-whats-a-reproducible-example-reprex-and-how-do-i-create-one/5219&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;REPREX&lt;/a&gt; (REPRoducible EXamples) is not available.&lt;/li&gt;
&lt;li&gt;It is error-prone and not efficient. Am I posing the right question? Do I look at the right places? It is not guaranteed that one finds the optimal solution. This is particularly awkward if the answer in the R community is very well known.&lt;/li&gt;
&lt;/ul&gt;



&lt;h2 id=&#34;looking-for-a-human-mentor&#34;&gt;Looking for a Human Mentor&lt;a href=&#34;#looking-for-a-human-mentor&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;I believe with a mentor, one could overcome these insecurities fast. The mentor — an experienced user — could ask questions to narrow the search space and point out helpful hints about what and where to look. Wikipedia, for instance, has established a similar program for their user community called Adopt-a-user.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Adopt-a-user program is designed to help new and inexperienced users by pairing them with more experienced Wikipedians. These editors (referred to as adopters or mentors) will “adopt” newer users, guiding them along the way as they learn about Wikipedia and its various aspects. (&lt;a href=&#34;https://en.wikipedia.org/wiki/Wikipedia:Adopt-a-user&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Wikipedia&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In Wikipedia, the intention is to help &lt;em&gt;novice&lt;/em&gt; contributors get orientation and some guided practice with the very complex rule set for writing or changing Wikipedia entries. My thought is to find a mentor to advance at the intermediate level. I think there is plenty of material for the R beginners freely available. But more important: You will learn R from scratch as an individual and do not need to worry at the beginning stage about an already developed complex rule which you have to observe and follow.&lt;/p&gt;
&lt;p&gt;As far as I know, there is no mentor program for R users. The next best alternative is a more open and friendly community. An excellent example, in my opinion, would be the &lt;a href=&#34;https://community.rstudio.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;RStudio Community&lt;/a&gt;. But even there, you should have a concrete question to ask.&lt;/p&gt;



&lt;h2 id=&#34;github-as-a-mentoring-tool&#34;&gt;GitHub as a Mentoring Tool&lt;a href=&#34;#github-as-a-mentoring-tool&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;



&lt;h3 id=&#34;an-instructive-example&#34;&gt;An instructive example&lt;a href=&#34;#an-instructive-example&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;I recently found out that GitHub could be used as an educational tool. I will you give an example which was very exciting for me:&lt;/p&gt;
&lt;p&gt;Often I was confronted with the problem of how to calculate and format nicely a contingency table in R. The free web material on the web on this question is abound (e.g., &lt;a href=&#34;https://www.datacamp.com/community/tutorials/contingency-tables-r&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Datacamp&lt;/a&gt;, &lt;a href=&#34;https://www.datasciencecentral.com/profiles/blogs/contingency-tables-in-r&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Data Science Central&lt;/a&gt;, &lt;a href=&#34;https://www.r-bloggers.com/2020/12/contingency-tables-in-r/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;R-Bloggers&lt;/a&gt;, &lt;a href=&#34;https://techvidvan.com/tutorials/r-contingency-tables/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;TechVidvan&lt;/a&gt;, &lt;a href=&#34;https://www.statology.org/contingency-table-in-r/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Statology&lt;/a&gt;, …). But many examples still teach the Base R commands. They do not mention new procedures with the &lt;a href=&#34;https://towardsdatascience.com/what-is-tidy-data-d58bb9ad2458&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;tidydata approach&lt;/a&gt; and related packages like &lt;a href=&#34;https://tidyr.tidyverse.org/articles/tidy-data.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;tidyr&lt;/a&gt;. And they do not worry about outputting the table in a publishing-ready format.&lt;/p&gt;
&lt;p&gt;There are many contingency tables published in the recently finished books &lt;a href=&#34;https://openintro-ims.netlify.app/index.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Introduction to Modern Statistics&lt;/a&gt;.&lt;/p&gt;
&lt;table style=&#34;width: 75%; margin-left: auto; margin-right: auto;&#34; class=&#34;table table-striped table-condensed&#34;&gt;
&lt;caption&gt;
Table 1: Descriptive statistics for the stent study.
&lt;/caption&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&#34;empty-cells: hide;border-bottom:hidden;&#34; colspan=&#34;1&#34;&gt;
&lt;/th&gt;
&lt;th style=&#34;border-bottom:hidden;padding-bottom:0; padding-left:3px;padding-right:3px;text-align: center; border-bottom: 2px solid&#34; colspan=&#34;2&#34;&gt;
&lt;div style=&#34;border-bottom: 1px solid #ddd; padding-bottom: 5px; &#34;&gt;
&lt;p&gt;30 days&lt;/p&gt;
&lt;/div&gt;
&lt;/th&gt;
&lt;th style=&#34;border-bottom:hidden;padding-bottom:0; padding-left:3px;padding-right:3px;text-align: center; border-bottom: 2px solid&#34; colspan=&#34;2&#34;&gt;
&lt;div style=&#34;border-bottom: 1px solid #ddd; padding-bottom: 5px; &#34;&gt;
&lt;p&gt;365 days&lt;/p&gt;
&lt;/div&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th style=&#34;text-align:left;&#34;&gt;
Group
&lt;/th&gt;
&lt;th style=&#34;text-align:right;&#34;&gt;
Stroke
&lt;/th&gt;
&lt;th style=&#34;text-align:right;&#34;&gt;
No event
&lt;/th&gt;
&lt;th style=&#34;text-align:right;&#34;&gt;
Stroke
&lt;/th&gt;
&lt;th style=&#34;text-align:right;&#34;&gt;
No event
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;border-top: 2px solid&#34;&gt;
Control
&lt;/td&gt;
&lt;td style=&#34;text-align:right;border-top: 2px solid&#34;&gt;
13
&lt;/td&gt;
&lt;td style=&#34;text-align:right;border-top: 2px solid&#34;&gt;
214
&lt;/td&gt;
&lt;td style=&#34;text-align:right;border-top: 2px solid&#34;&gt;
28
&lt;/td&gt;
&lt;td style=&#34;text-align:right;border-top: 2px solid&#34;&gt;
199
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
Treatment
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
33
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
191
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
45
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
179
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;border-top: 2px solid&#34;&gt;
Total
&lt;/td&gt;
&lt;td style=&#34;text-align:right;border-top: 2px solid&#34;&gt;
46
&lt;/td&gt;
&lt;td style=&#34;text-align:right;border-top: 2px solid&#34;&gt;
405
&lt;/td&gt;
&lt;td style=&#34;text-align:right;border-top: 2px solid&#34;&gt;
73
&lt;/td&gt;
&lt;td style=&#34;text-align:right;border-top: 2px solid&#34;&gt;
378
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;I could look up the &lt;a href=&#34;https://github.com/openintrostat/ims/edit/master/01-data-hello.Rmd&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;source code from lines 85-101 via GitHub&lt;/a&gt; and learn how to produce the above table. (In the following code chunk, I have focussed on the table appearance and left out different previous data transformations to prepare the two data sets &lt;a href=&#34;http://openintrostat.github.io/openintro/reference/stent30.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;code&gt;stent30&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;http://openintrostat.github.io/openintro/reference/stent365.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;code&gt;stent365&lt;/code&gt;&lt;/a&gt;. Furthermore, the code differs somewhat from the original due to some CSS styles of this website.).&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-markdown&#34;&gt;```{r stent-study}
suppressMessages(library(janitor))
suppressMessages(library(kableExtra))
suppressMessages(library(openintro))
suppressMessages(library(tidyverse))

stent %&amp;gt;%
  mutate(group = str_to_title(group)) %&amp;gt;%
  pivot_longer(cols = c(`30 days`, `365 days`), 
               names_to = &amp;quot;stage&amp;quot;, 
               values_to = &amp;quot;outcome&amp;quot;) %&amp;gt;%
  count(group, stage, outcome) %&amp;gt;%
  pivot_wider(names_from = c(stage, outcome), values_from = n) %&amp;gt;%
  adorn_totals(where = &amp;quot;row&amp;quot;) %&amp;gt;%
  kbl(linesep = &amp;quot;&amp;quot;, booktabs = TRUE, caption = &amp;quot;Descriptive statistics for the stent study.&amp;quot;,
      col.names = c(&amp;quot;Group&amp;quot;, &amp;quot;Stroke&amp;quot;, &amp;quot;No event&amp;quot;, &amp;quot;Stroke&amp;quot;, &amp;quot;No event&amp;quot;),
      table.attr = &amp;quot;style=&#39;width: 75%;&#39;&amp;quot;) %&amp;gt;%
  add_header_above(c(&amp;quot; &amp;quot; = 1, &amp;quot;30 days&amp;quot; = 2, &amp;quot;365 days&amp;quot; = 2), extra_css = &amp;quot;border-bottom: 2px solid&amp;quot;) %&amp;gt;%
  row_spec(1, extra_css = &amp;quot;border-top: 2px solid&amp;quot;) %&amp;gt;%
  row_spec(3, extra_css = &amp;quot;border-top: 2px solid&amp;quot;) %&amp;gt;%
  kable_styling(bootstrap_options = c(&amp;quot;striped&amp;quot;, &amp;quot;condensed&amp;quot;), 
                latex_options = c(&amp;quot;striped&amp;quot;, &amp;quot;hold_position&amp;quot;),
                full_width = T, position = &#39;center&#39;)
```
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;lesson-learned&#34;&gt;Lesson learned&lt;a href=&#34;#lesson-learned&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Looking into the source code at GitHub, I learned several issues:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I experimented already with the &lt;code&gt;janitor&lt;/code&gt; package, and I am happy to get the confirmation that it is a widely used package to “provide quick counts of variable combinations (i.e., frequency tables and crosstabs)” and to “format [nicely] the tabulation results.” (From the Janitor package description.)&lt;/li&gt;
&lt;li&gt;I also did know about the &lt;code&gt;kableExtra&lt;/code&gt; package and had the &lt;code&gt;kable_styling&lt;/code&gt; function already used several times.&lt;/li&gt;
&lt;li&gt;The other &lt;code&gt;kableExtra&lt;/code&gt; functions (&lt;code&gt;add_header_above()&lt;/code&gt;, &lt;code&gt;row_spec()&lt;/code&gt;, &lt;code&gt;kbl()&lt;/code&gt;) I had not used before. Especially &lt;code&gt;add_header_above()&lt;/code&gt; has an important role for special headings in contingency tables.&lt;/li&gt;
&lt;li&gt;The parameter &lt;code&gt;extra_css&lt;/code&gt; was entirely new for me. I have never heard about it and didn’t even know that it exists.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For me, this learning experience was very instructive! I admit that this example could have been asked via a friendly forum: For instance: “How could I produce a contingency table formatted professionally for print by using the tidyverse approach?” Additionally, one would have to provide some code to show where one stands and what approach one is using.&lt;/p&gt;



&lt;h3 id=&#34;looking-experts-over-their-shoulders&#34;&gt;Looking Experts over their Shoulders&lt;a href=&#34;#looking-experts-over-their-shoulders&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;But this was just one example where I knew about the problem and had already tried several approaches to find a solution. But what about code patterns I didn’t even know and could therefore not ask the right question?&lt;/p&gt;
&lt;p&gt;Finding a GitHub project with code snippets one needs urgently is just the beginning. There is a big chance that the same repository (aka ‘repo’) hides more code snippets to learn from. And maybe the person behind this one GitHub repos maintains other repositories that are also very interesting?&lt;/p&gt;
&lt;p&gt;In my case, it turned out that &lt;a href=&#34;https://github.com/mine-cetinkaya-rundel&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Mine Çetakaya-Rundel&lt;/a&gt;, one of the authors and the person responsible for the repository management, has educational approaches that are similar to mine. But she is way off more skilled in R and statistics. I am especially interested in her usage of the &lt;code&gt;learnr&lt;/code&gt; package for interactive tutorials and have watched a series of three videos on &lt;a href=&#34;https://mine-cetinkaya-rundel.github.io/teach-r-online/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Teaching Statistics and Data Science Online&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In a certain sense, she functions as a mentor for me — even if she doesn’t know about it 🥸. Meanwhile, we had some exchanges on GitHub issues as I am interested in learning how to use the &lt;code&gt;learnr&lt;/code&gt; package for introductions into statistics via R-Tutorials. Regularly if I find a problem as a user reading and following the tutorial exercises, I try to fix the code in my fork and send the &lt;a href=&#34;https://github.com/OpenIntroStat/ims-tutorials/pulls?q=is%3Apr&amp;#43;author%3A%40me&amp;#43;&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;solutions as pull requests (PR)&lt;/a&gt; to Mine. Besides learning to use GitHub in a collaborative setting, I have already profited in many ways. I learned about packages I have never heard of (see, for example, the &lt;a href=&#34;https://github.com/OpenIntroStat/ims/blob/master/_common.R&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;list of packages used for the book&lt;/a&gt;) and saw code snippets that transformed data in a much more elegant way as I used to do.&lt;/p&gt;



&lt;h2 id=&#34;summary&#34;&gt;Summary&lt;a href=&#34;#summary&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;To inspect code on GitHub is a suitable strategy for intermediate (programming) learners. I illustrated it with an R example, but I think you could generalize it as a learning strategy. I recommend the following steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Note names and/or repositories you learned from successful internet recherche&lt;/strong&gt;. By searching answers or asking questions via StackOverflow, you will encounter the same names, blog addresses, Twitter messages, repos again and again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Look around if these person/websites generally work on problems you are interested in&lt;/strong&gt;. Look into the profile and follow the activities of these persons on their blog, Twitter, YouTube, GitHub … accounts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Decide on a person and select a specific project&lt;/strong&gt;. I recommend focusing not only on a particular person but also on picking one project to concentrate on. Ideally, it is a current project the person is still interested in and produces code you want to learn and use for your own work later on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Think about a possibility to get involved in the project&lt;/strong&gt;. The idea is to give the person and the community something back for its/their mentoring function and commit yourself to relevant real-world problems. The possibilities depend on your skills and interests. It may be advertising the project, writing a favorable review, fixing typos, commenting via the issue part of the repo, recommending code changes via PRs, or financially supporting the author(s) and/or the ongoing project.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Finally, I would like to add also a warning: “Following” a person should not develop to stalking. It is essential not to be intrusive or pushy. You will see already after a short time if the person values your contribution(s), e.g., by answering friendly or thoughtfully, accepting your PRs, etc. If you get the impression that your engagement is disruptive, then stop it immediately. Either look at the code silently without interaction or try to find another “mentor” or project to get involved.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Images in Rmarkdown Files</title>
      <link>https://notes.peter-baumgartner.net/2021/05/07/images-in-rmarkdown-files/</link>
      <pubDate>Fri, 07 May 2021 00:00:00 +0000</pubDate>
      <guid>https://notes.peter-baumgartner.net/2021/05/07/images-in-rmarkdown-files/</guid>
      <description>


&lt;h2 id=&#34;using-r-chunk-with-knitr&#34;&gt;Using R chunk with &lt;code&gt;knitr&lt;/code&gt;&lt;a href=&#34;#using-r-chunk-with-knitr&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Using R chunks with &lt;code&gt;knitr&lt;/code&gt; has the full features as outlined in the post &lt;a href=&#34;../images-from-rmd-to-html-format/#example&#34;&gt;Images: From R Markdown to HTML format&lt;/a&gt;.&lt;/p&gt;



&lt;h3 id=&#34;example&#34;&gt;Example&lt;a href=&#34;#example&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;div class=&#34;figure&#34; style=&#34;text-align: center&#34;&gt;
&lt;img src=&#34;images/my-image.png&#34; alt=&#34;Caption for this figure 1&#34; width=&#34;100%&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;Figure 1: Caption for this figure 1&lt;/p&gt;
&lt;/div&gt;



&lt;h3 id=&#34;code-in-r-chunk&#34;&gt;Code in R Chunk&lt;a href=&#34;#code-in-r-chunk&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;```
{r img-with-knitr, echo=FALSE, fig.align=&#39;center&#39;, out.width=&#39;100%&#39;, fig.cap=&#39;Caption for this figure 1&#39;}
knitr::include_graphics(&amp;quot;images/my-image.png&amp;quot;)
```
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;code-in-html&#34;&gt;Code in HTML&lt;a href=&#34;#code-in-html&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;```
&amp;lt;div class=&amp;quot;figure&amp;quot; style=&amp;quot;text-align: center&amp;quot;&amp;gt;
    &amp;lt;span id=&amp;quot;fig:img-with-knitr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;
    &amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;Caption for this figure 1&amp;quot; width=&amp;quot;100%&amp;quot;/&amp;gt;
    &amp;lt;p class=&amp;quot;caption&amp;quot;&amp;gt;Figure 1: Caption for this figure 1&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;

```
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;css&#34;&gt;CSS&lt;a href=&#34;#css&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;div.figure {
        border: 1px;
        border-style: groove;
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px  rgba(0, 0, 0, 0.19);
}

p.caption {
    text-align: center;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
    font-size: smaller;
}
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;summary&#34;&gt;Summary&lt;a href=&#34;#summary&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: yes (format: &amp;ldquo;fig:&amp;lt;chunk name&amp;gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: yes (with &lt;code&gt;out.extra&lt;/code&gt;, example: &lt;code&gt;out.extra=&#39;class=&amp;quot;border shadowed&amp;quot;&#39;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: yes (with out.extra, example: &lt;code&gt;out.extra=&#39;style=&amp;quot;background-color: #9ecff7; padding:10px; display: inline-block;&amp;quot;&#39;&lt;/code&gt; See blog post &lt;a href=&#34;http://zevross.com/blog/2017/06/19/tips-and-tricks-for-working-with-images-and-figures-in-r-markdown-documents/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Tips and tricks for working with images and figures in R Markdown documents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;



&lt;h2 id=&#34;markdown-via-addins-insert-image&#34;&gt;Markdown via Addins &amp;lsquo;Insert Image&amp;rsquo;&lt;a href=&#34;#markdown-via-addins-insert-image&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;The behavior is the same as in &lt;a href=&#34;../images-in-md-files&#34;&gt;Images in .md files&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Using the RStudio Addin window without the width or height parameter it just generate markdown code. Is the width or height parameter included then HTML is generated but without &lt;code&gt;div.figure&lt;/code&gt; and &lt;code&gt;p.caption&lt;/code&gt; class. There is no caption visible and the CSS styling has to be done with &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;



&lt;h3 id=&#34;example-1&#34;&gt;Example&lt;a href=&#34;#example-1&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;img src=&#34;images/my-image.png&#34; alt=&#34;Alt text&#34; width=&#34;100%&#34;/&gt;
&lt;div class=&#34;alert alert-warning&#34;&gt;
  &lt;div&gt;
    You can&amp;rsquo;t use the Addins &amp;lsquo;Insert Image&amp;rsquo; in Visual R Markdown mode because it protects the conversion by adding a backslash in front of the squared brackets: &lt;code&gt;!\[Alt text\](images/my-image.png)&lt;/code&gt;.
  &lt;/div&gt;
&lt;/div&gt;



&lt;h3 id=&#34;code-in-markdown&#34;&gt;Code in markdown&lt;a href=&#34;#code-in-markdown&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The first line is the markdown code for images without width/height parameters. The second line has a width parameter.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;![Alt text](images/my-image.png)
&amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;Alt text&amp;quot; width=&amp;quot;100%&amp;quot;/&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;code-in-html-1&#34;&gt;Code in HTML&lt;a href=&#34;#code-in-html-1&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The first line is the HTML code for images without width/height parameters. The second line has a width parameter.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;Alt text&amp;quot;&amp;gt;&amp;lt;/p&amp;gt; 
&amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;Alt text&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;css-1&#34;&gt;CSS&lt;a href=&#34;#css-1&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;If the RStudio Addin window is used, then the &lt;code&gt;img&lt;/code&gt; tag should be wrapped into a paragraph. Otherwise it would be generate a conflict with other tags related with images.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-css&#34;&gt;p img {
    border: 1px;
    border-style: groove;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px  rgba(0, 0, 0, 0.19);
}

&lt;/code&gt;&lt;/pre&gt;
&lt;style type=&#34;text/css&#34;&gt;
p img {
    border: 1px;
    border-style: groove;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px  rgba(0, 0, 0, 0.19);
}

&lt;/style&gt;



&lt;h3 id=&#34;summary-1&#34;&gt;Summary&lt;a href=&#34;#summary-1&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;So &amp;ndash; all in all &amp;ndash; the Addins window is not very useful. The only advantage is the generation of the filepath and the copy of the image in the correct folder.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;



&lt;h2 id=&#34;visual-r-markdown-via-menu-insert-&#34;&gt;Visual R Markdown via Menu &amp;lsquo;Insert &amp;hellip;&amp;rsquo;&lt;a href=&#34;#visual-r-markdown-via-menu-insert-&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Again the same behavior as in &lt;a href=&#34;../images-in-md-files&#34;&gt;Images in .md files&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;With a &lt;code&gt;.Rmarkdown&lt;/code&gt; file Visual R Markdown offers only a reduced first part of the window as it is presented in an &lt;code&gt;.Rmd&lt;/code&gt; file. In contrast to the .Rmd version it lacks the fields to add width and height parameter.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;images/reduced-window-version-for-md-files-min.png&#34; alt=&#34;Window for inserting images in .md files with Visual R Markdown window with reduced number of input fields.&#34; title=&#34;text for title and tooltip&#34;&gt;&lt;/p&gt;
&lt;p&gt;But more important: There is no &lt;code&gt;caption&lt;/code&gt;! The text for the field &amp;lsquo;Caption/Alt&amp;rsquo; includes the text only for the &lt;code&gt;alt&lt;/code&gt;-attribute!&lt;/p&gt;



&lt;h3 id=&#34;example-2&#34;&gt;Example&lt;a href=&#34;#example-2&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;img src=&#34;images/my-image.png&#34; alt=&#34;Alt text (no caption!)&#34; title=&#34;Text for title and tooltip&#34;&gt;&lt;/p&gt;



&lt;h3 id=&#34;code-in-markdown-1&#34;&gt;Code in markdown&lt;a href=&#34;#code-in-markdown-1&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;![Alt text (no caption!)](images/my-image.png &amp;quot;Text for title and tooltip&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;code-in-html-2&#34;&gt;Code in HTML&lt;a href=&#34;#code-in-html-2&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;Alt text (no caption!)&amp;quot; title=&amp;quot;Text for title and tooltip&amp;quot;&amp;gt;&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;css-2&#34;&gt;CSS&lt;a href=&#34;#css-2&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The same as with the RStudio Addin window.&lt;/p&gt;



&lt;h3 id=&#34;summary-2&#34;&gt;Summary&lt;a href=&#34;#summary-2&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;



&lt;h2 id=&#34;hugo-figure-shortcut&#34;&gt;Hugo figure shortcut&lt;a href=&#34;#hugo-figure-shortcut&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Here again &amp;ndash; as in the .md file &amp;ndash; we do not need to protect the shortcode. We can insert it either via the Visual R Markdown menu &lt;code&gt;Insert -&amp;gt; Shortcode&lt;/code&gt; or write the code directly into markdown.&lt;/p&gt;



&lt;h3 id=&#34;example-3&#34;&gt;Example&lt;a href=&#34;#example-3&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;














&lt;figure class=&#34;center&#34; id=&#34;figure-figure-4-my-title-text&#34;&gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;
        &lt;img alt=&#34;my-alt text&#34; srcset=&#34;
               /2021/05/07/images-in-rmarkdown-files/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png 400w,
               /2021/05/07/images-in-rmarkdown-files/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_c4c18b47561549b1147ccf6dd152b5f0.png 760w,
               /2021/05/07/images-in-rmarkdown-files/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1200x1200_fit_lanczos_2.png 1200w&#34;
               src=&#34;https://notes.peter-baumgartner.net/2021/05/07/images-in-rmarkdown-files/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png&#34;
               width=&#34;754&#34;
               height=&#34;226&#34;
               loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;figcaption&gt;
      Figure 4: my title-text
    &lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Everything I said about the features of the figure shortcode in the post &lt;a href=&#34;https://notes.peter-baumgartner.net/2021/05/05/images-from-rmd-to-html-format/#example-3&#34;&gt;Images: From R Markdown to HTML format&lt;/a&gt; applies for &lt;code&gt;.md&lt;/code&gt; and for .Rmarkdown files as well.&lt;/p&gt;



&lt;h3 id=&#34;summary-3&#34;&gt;Summary&lt;a href=&#34;#summary-3&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: yes (Academic theme)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: no (zoomable)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: yes (Academic theme)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;



&lt;h2 id=&#34;results-and-conclusion&#34;&gt;Results and Conclusion&lt;a href=&#34;#results-and-conclusion&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th style=&#34;text-align:center&#34;&gt;knitr&lt;/th&gt;
&lt;th style=&#34;text-align:center&#34;&gt;Addin&lt;/th&gt;
&lt;th style=&#34;text-align:center&#34;&gt;Visual&lt;/th&gt;
&lt;th style=&#34;text-align:center&#34;&gt;Hugo&lt;/th&gt;
&lt;th&gt;Remark&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Caption&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C. format&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌ 1&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌ 1&lt;/td&gt;
&lt;td&gt;1) standard = bold&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C.numbered&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅ 2&lt;/td&gt;
&lt;td&gt;2) via &amp;lsquo;Academic&amp;rsquo; theme&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alt&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Title&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tooltip&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Width/Height&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Link to&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ID&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅ 3&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅ 4&lt;/td&gt;
&lt;td&gt;3) &lt;code&gt;fig:&amp;lt;chunk name&amp;gt;&lt;/code&gt; 4) &lt;code&gt;figure-&amp;lt;caption text&amp;gt;&lt;/code&gt; or &amp;lsquo;Academic&amp;rsquo; theme&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CSS&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Other&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌5&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅ 6&lt;/td&gt;
&lt;td&gt;1) via output chunk arbitrary HTML code! 4) &lt;code&gt;target&lt;/code&gt;, &lt;code&gt;rel&lt;/code&gt;, &lt;code&gt;attr&lt;/code&gt;, &lt;code&gt;attrlink&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Table&lt;/strong&gt;: Features of different method of inserting images in &lt;code&gt;.Rmarkdown&lt;/code&gt; files converting to &lt;code&gt;.markdown&lt;/code&gt; using Pandoc and Hugo/Goldmark.&lt;/p&gt;
&lt;p&gt;Although both windows (Addins and Visual R Markdown windows) are not equipped with all the necessary attributes, here we have in contrast to &lt;code&gt;.md&lt;/code&gt; files also the alternative with &lt;code&gt;knitr&lt;/code&gt; chunks. So in way: &lt;code&gt;.Rmarkdown&lt;/code&gt; files are the best of both worlds! (This is also true with the Table of Contents, which works here as well.)&lt;/p&gt;
&lt;p&gt;&lt;span class=&#39;Z3988&#39; title=&#39;url_ver=Z39.88-2004&amp;amp;ctx_ver=Z39.88-2004&amp;amp;rfr_id=info%3Asid%2Fzotero.org%3A2&amp;amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;amp;rft.type=blogPost&amp;amp;rft.title=Images%20in%20Rmarkdown%20Files&amp;amp;rft.source=Thought%20splinters&amp;amp;rft.rights=CC%20BY-SA%204.0&amp;amp;rft.description=The%20post%20investigates%20different%20methods%20to%20include%20images%20in%20%60.Rmd%60%20files%20and%20how%20they%20are%20treated%20in%20the%20%60blogdown%60%20conversion%20process%20to%20.markdown%20files.&amp;amp;rft.identifier=https%3A%2F%2Fnotes.peter-baumgartner.net%2F2021%2F05%2F07%2Fimages-in-rmarkdown-files&amp;amp;rft.aufirst=Peter&amp;amp;rft.aulast=Baumgartner&amp;amp;rft.au=Peter%20Baumgartner&amp;amp;rft.date=2021-05-07&amp;amp;rft.language=en&#39;&gt;&lt;/span&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Images in .md Files</title>
      <link>https://notes.peter-baumgartner.net/2021/05/06/images-in-md-files/</link>
      <pubDate>Thu, 06 May 2021 00:00:00 +0000</pubDate>
      <guid>https://notes.peter-baumgartner.net/2021/05/06/images-in-md-files/</guid>
      <description>


&lt;h2 id=&#34;markdown-via-addins-insert-image&#34;&gt;Markdown via Addins &amp;lsquo;Insert Image&amp;rsquo;&lt;a href=&#34;#markdown-via-addins-insert-image&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Using the RStudio Addin window without the width or height parameter it just generate markdown code. Is the width or height parameter included then HTML is generated but without &lt;code&gt;div.figure&lt;/code&gt; and &lt;code&gt;p.caption&lt;/code&gt; class. There is no caption visible and the CSS styling has to be done with &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;



&lt;h3 id=&#34;example&#34;&gt;Example&lt;a href=&#34;#example&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;img src=&#34;images/my-image.png&#34; alt=&#34;Alt text&#34; width=&#34;100%&#34;/&gt;
&lt;div class=&#34;alert alert-warning&#34;&gt;
  &lt;div&gt;
    You can&amp;rsquo;t use the Addins &amp;lsquo;Insert Image&amp;rsquo; in Visual R Markdown mode because it protects the conversion by adding a backslash in front of the squared brackets: &lt;code&gt;!\[Alt text\](images/my-image.png)&lt;/code&gt;.
  &lt;/div&gt;
&lt;/div&gt;



&lt;h3 id=&#34;code-in-markdown&#34;&gt;Code in markdown&lt;a href=&#34;#code-in-markdown&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The first line is the markdown code for images without width/height parameters. The second line has a width parameter.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;![Alt text](images/my-image.png)
&amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;Alt text&amp;quot; width=&amp;quot;100%&amp;quot;/&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;code-in-html&#34;&gt;Code in HTML&lt;a href=&#34;#code-in-html&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The first line is the HTML code for images without width/height parameters. The second line has a width parameter.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;Alt text&amp;quot;&amp;gt;&amp;lt;/p&amp;gt; 
&amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;Alt text&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;css&#34;&gt;CSS&lt;a href=&#34;#css&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;If the RStudio Addin window is used, then the &lt;code&gt;img&lt;/code&gt; tag should be wrapped into a paragraph. Otherwise it would be generate a conflict with other tags related with images.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-{css}&#34;&gt;p img {
    border: 1px;
    border-style: groove;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px  rgba(0, 0, 0, 0.19);
}

&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;summary&#34;&gt;Summary&lt;a href=&#34;#summary&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;So &amp;ndash; all in all &amp;ndash; the Addins window is not very useful. The only advantage is the generation of the filepath and the copy of the image in the correct folder.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;



&lt;h2 id=&#34;visual-r-markdown-via-menu-insert-&#34;&gt;Visual R Markdown via Menu &amp;lsquo;Insert &amp;hellip;&amp;rsquo;&lt;a href=&#34;#visual-r-markdown-via-menu-insert-&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;With a &lt;code&gt;.md&lt;/code&gt; file Visual R Markdown offers only a reduced first part of the window as it is presented in an &lt;code&gt;.Rmd&lt;/code&gt; file. In contrast to the .Rmd version it lacks the fields to add width and height parameter.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;images/reduced-window-version-for-md-files-min.png&#34; alt=&#34;Window for inserting images in .md files with Visual R Markdown window with reduced number of input fields.&#34; title=&#34;text for title and tooltip&#34;&gt;&lt;/p&gt;
&lt;p&gt;But more important: There is no &lt;code&gt;caption&lt;/code&gt;! The text for the field &amp;lsquo;Caption/Alt&amp;rsquo; includes the text only for the &lt;code&gt;alt&lt;/code&gt;-attribute!&lt;/p&gt;



&lt;h3 id=&#34;example-1&#34;&gt;Example&lt;a href=&#34;#example-1&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;img src=&#34;images/my-image.png&#34; alt=&#34;Alt text (no caption!)&#34; title=&#34;Text for title and tooltip&#34;&gt;&lt;/p&gt;



&lt;h3 id=&#34;code-in-markdown-1&#34;&gt;Code in markdown&lt;a href=&#34;#code-in-markdown-1&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;![Alt text (no caption!)](images/my-image.png &amp;quot;Text for title and tooltip&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;code-in-html-1&#34;&gt;Code in HTML&lt;a href=&#34;#code-in-html-1&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;Alt text (no caption!)&amp;quot; title=&amp;quot;Text for title and tooltip&amp;quot;&amp;gt;&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;h3 id=&#34;css-1&#34;&gt;CSS&lt;a href=&#34;#css-1&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The same as with the RStudio Addin window.&lt;/p&gt;



&lt;h3 id=&#34;summary-1&#34;&gt;Summary&lt;a href=&#34;#summary-1&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;



&lt;h2 id=&#34;hugo-figure-shortcut&#34;&gt;Hugo figure shortcut&lt;a href=&#34;#hugo-figure-shortcut&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;In contrast to the .Rmd file we do not need to protect the shortcode. We can insert it either via the Visual R Markdown menu &lt;code&gt;Insert -&amp;gt; Shortcode&lt;/code&gt; or write the code directly into markdown.&lt;/p&gt;



&lt;h3 id=&#34;example-2&#34;&gt;Example&lt;a href=&#34;#example-2&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;














&lt;figure class=&#34;center&#34; id=&#34;figure-figure-4-my-title-text&#34;&gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;
        &lt;img alt=&#34;my-alt text&#34; srcset=&#34;
               /2021/05/06/images-in-md-files/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png 400w,
               /2021/05/06/images-in-md-files/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_c4c18b47561549b1147ccf6dd152b5f0.png 760w,
               /2021/05/06/images-in-md-files/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1200x1200_fit_lanczos_2.png 1200w&#34;
               src=&#34;https://notes.peter-baumgartner.net/2021/05/06/images-in-md-files/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png&#34;
               width=&#34;754&#34;
               height=&#34;226&#34;
               loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;figcaption&gt;
      Figure 4: my title-text
    &lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Everything I said about the features of the figure shortcode in the post &lt;a href=&#34;../images-from-rmd-to-html-format/#example-3&#34;&gt;Images: From R Markdown to HTML format&lt;/a&gt; applies for &lt;code&gt;.md&lt;/code&gt; files as well.&lt;/p&gt;



&lt;h3 id=&#34;summary-2&#34;&gt;Summary&lt;a href=&#34;#summary-2&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: yes (Academic theme)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: no (zoomable)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: yes (Academic theme)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;



&lt;h2 id=&#34;results-and-conclusion&#34;&gt;Results and Conclusion&lt;a href=&#34;#results-and-conclusion&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th style=&#34;text-align:center&#34;&gt;Addin&lt;/th&gt;
&lt;th style=&#34;text-align:center&#34;&gt;Visual&lt;/th&gt;
&lt;th style=&#34;text-align:center&#34;&gt;Hugo&lt;/th&gt;
&lt;th&gt;Remark&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Caption&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C. format&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌ 1&lt;/td&gt;
&lt;td&gt;1) standard = bold&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C.numbered&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅ 2&lt;/td&gt;
&lt;td&gt;2) via &amp;lsquo;Academic&amp;rsquo; theme&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alt&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Title&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tooltip&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Width/Height&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Link to&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ID&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅ 3&lt;/td&gt;
&lt;td&gt;3) &lt;code&gt;figure-&amp;lt;caption text&amp;gt;&lt;/code&gt; or &amp;lsquo;Academic&amp;rsquo; theme&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CSS&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Other&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;❌&lt;/td&gt;
&lt;td style=&#34;text-align:center&#34;&gt;✅ 4&lt;/td&gt;
&lt;td&gt;4) &lt;code&gt;target&lt;/code&gt;, &lt;code&gt;rel&lt;/code&gt;, &lt;code&gt;attr&lt;/code&gt;, &lt;code&gt;attrlink&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Table&lt;/strong&gt;: Features of different method of inserting images in &lt;code&gt;.md&lt;/code&gt; files converting with Hugo/Goldmark to HTML&lt;/p&gt;
&lt;p&gt;Only Hugo shortcode (with ID and numbered extension by the Academic theme) is the only real choice for figures equipped with all necessary attributes and nice styled.&lt;/p&gt;
&lt;p&gt;&lt;span class=&#39;Z3988&#39; title=&#39;url_ver=Z39.88-2004&amp;amp;ctx_ver=Z39.88-2004&amp;amp;rfr_id=info%3Asid%2Fzotero.org%3A2&amp;amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;amp;rft.type=blogPost&amp;amp;rft.title=Images%20in%20.md%20Files&amp;amp;rft.source=Thought%20splinters&amp;amp;rft.rights=CC%20BY-SA%204.0&amp;amp;rft.description=The%20post%20investigates%20different%20methods%20to%20include%20images%20in%20%60.md%60%20files%20and%20how%20they%20are%20treated%20in%20the%20Hugo/Goldmark%20conversion%20process%20to%20HTML.&amp;amp;rft.identifier=post%2F2021%2F2021-05-06-images-in-md-files%2Fimages-in-md-files&amp;amp;rft.aufirst=Peter&amp;amp;rft.aulast=Baumgartner&amp;amp;rft.au=Peter%20Baumgartner&amp;amp;rft.date=2021-05-06&amp;amp;rft.language=en&#39;&gt;&lt;/span&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Images: From R Markdown to HTML format</title>
      <link>https://notes.peter-baumgartner.net/2021/05/05/images-from-rmd-to-html-format/</link>
      <pubDate>Wed, 05 May 2021 00:00:00 +0000</pubDate>
      <guid>https://notes.peter-baumgartner.net/2021/05/05/images-from-rmd-to-html-format/</guid>
      <description>
&lt;script src=&#34;https://notes.peter-baumgartner.net/2021/05/05/images-from-rmd-to-html-format/index.en_files/header-attrs/header-attrs.js&#34;&gt;&lt;/script&gt;

&lt;div id=&#34;TOC&#34;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#introduction&#34;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#using-r-chunk-with-knitr&#34;&gt;Using r chunk with &lt;code&gt;knitr&lt;/code&gt;&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#example&#34;&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-r-chunk&#34;&gt;Code in R Chunk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-html&#34;&gt;Code in HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#css&#34;&gt;CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#summary&#34;&gt;Summary&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#markdown-via-addins-insert-image&#34;&gt;Markdown via Addins ‘Insert Image’&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#example-1&#34;&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-markdown&#34;&gt;Code in markdown&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-html-1&#34;&gt;Code in HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#css-1&#34;&gt;CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#summary-1&#34;&gt;Summary&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#visual-r-markdown-via-menu-insert&#34;&gt;Visual R Markdown via Menu ‘Insert …’&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#example-2&#34;&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-markdown-1&#34;&gt;Code in markdown&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-html-2&#34;&gt;Code in HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#css-2&#34;&gt;CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#summary-2&#34;&gt;Summary&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#hugo-figure-shortcut&#34;&gt;Hugo figure shortcut&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#example-3&#34;&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-html-chunk&#34;&gt;Code in HTML chunk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#css-3&#34;&gt;CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#summary-3&#34;&gt;Summary&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#results-and-conclusion&#34;&gt;Results and Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div id=&#34;introduction&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;This article is the first of a series of posts to investigate methods of inserting figures into different markdown formats. The resulting code depends on how images are included and the conversion tool they have to undergo. And — at least I think — also somewhat on the theme in use. In my case it is the blog widget of the &lt;code&gt;starter-academic&lt;/code&gt; theme.&lt;/p&gt;
&lt;p&gt;Here I look at the process chain from Rmd via &lt;a href=&#34;https://pandoc.org/&#34;&gt;Pandoc&lt;/a&gt; to HTML. I will inspect inserting images with the following methods:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;R chunk code via &lt;code&gt;knitr::include_graphics()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;‘Insert Image’ window via blogdown Addins&lt;/li&gt;
&lt;li&gt;‘Image …’ window vial Visual R Markdown&lt;/li&gt;
&lt;li&gt;Hugo shortcode&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Of course, you can always include HTML instead of markdown code, but this case is not of interest here as there are no changes during the conversion process.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;using-r-chunk-with-knitr&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Using r chunk with &lt;code&gt;knitr&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;You can include external images with the &lt;a href=&#34;https://www.rdocumentation.org/packages/knitr/versions/1.33/topics/include_graphics&#34;&gt;knitr function &lt;code&gt;include_graphics()&lt;/code&gt;&lt;/a&gt;. There are &lt;a href=&#34;https://yihui.org/knitr/options/#plots&#34;&gt;many chunk options&lt;/a&gt; to specify the resulting figure, but not all are useful for external images.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;out.width&lt;/code&gt; and &lt;code&gt;out.height&lt;/code&gt; (not &lt;code&gt;fig.width&lt;/code&gt; or &lt;code&gt;fig.height&lt;/code&gt;, they are for R-generated plots)&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;out.extra&lt;/code&gt; to add CSS styles (see for details &lt;a href=&#34;http://zevross.com/blog/2017/06/19/tips-and-tricks-for-working-with-images-and-figures-in-r-markdown-documents/#style-your-image-environment-with-css&#34;&gt;Style your image environment with CSS&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;fig.cap&lt;/code&gt; is provided without &lt;code&gt;fig.alt&lt;/code&gt;, it will also function as alternative text, which is usually not desired.&lt;/li&gt;
&lt;li&gt;Use &lt;a href=&#34;https://bookdown.org/yihui/rmarkdown-cookbook/output-hooks.html&#34;&gt;output hooks&lt;/a&gt; if you want even more control.&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&#34;example&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;div class=&#34;figure&#34; style=&#34;text-align: center&#34;&gt;&lt;span id=&#34;fig:img-with-knitr&#34;&gt;&lt;/span&gt;
&lt;img src=&#34;images/my-image.png&#34; alt=&#34;Alternative text for figure 1&#34; width=&#34;50%&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;
Figure 1: Caption for figure 1
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-warning&#34;&gt;
  &lt;div&gt;
    The &lt;code&gt;fig.align&lt;/code&gt; parameter generally works correctly, but not in this theme. It always centers to a 10 (instead 0f 12) column width. Left and right alignments do not work at all. I could not find and solve the problem.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-r-chunk&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in R Chunk&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;```
{r img-with-knitr, echo=FALSE, fig.align=&amp;#39;center&amp;#39;, out.width=&amp;#39;50%&amp;#39;, fig.cap=&amp;#39;Caption for figure 1&amp;#39;, fig.alt=&amp;#39;Alternative text for figure 1&amp;#39;}
knitr::include_graphics(&amp;quot;images/my-image.png&amp;quot;)
```&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-html&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in HTML&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;```
&amp;lt;div class=&amp;quot;figure&amp;quot; style=&amp;quot;text-align: center&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;fig:img-with-knitr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;
    &amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;Alternative text for figure 1&amp;quot; width=&amp;quot;50%&amp;quot;&amp;gt;
    &amp;lt;p class=&amp;quot;caption&amp;quot;&amp;gt;
        Figure 1: Caption for figure 1
    &amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
```&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is a stand-alone feature of &lt;code&gt;knitr&lt;/code&gt; to provide automatically generated figure numbers that you can reference via their id. The id is generated from the chunk name with the pattern &lt;code&gt;fig:&amp;lt;chunk name&amp;gt;&lt;/code&gt;. The figure 1 above can be referenced with &lt;code&gt;\@ref(fig:img-with-knitr)&lt;/code&gt;. Like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For more details see Figure &lt;a href=&#34;#fig:img-with-knitr&#34;&gt;1&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-note&#34;&gt;
  &lt;div&gt;
    But in that case, you cannot use other methods to insert figures with numbers as &lt;code&gt;knitr&lt;/code&gt; will not be aware of them.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;The relevant selectors for CSS styles are &lt;code&gt;div.figure&lt;/code&gt; and &lt;code&gt;p.caption&lt;/code&gt;. We will see that these styles are consistent with all the other methods provided by RStudio windows. But Hugo’s figure shortcode uses the HTML tags &lt;code&gt;figure&lt;/code&gt; and &lt;code&gt;figcaption&lt;/code&gt;. In the &lt;a href=&#34;https://bookdown.org/yihui/rmarkdown-cookbook/hook-html5.html&#34;&gt;R Markdown Coobook&lt;/a&gt; is a work around expained how you can produce these Hugo HTML tags with &lt;code&gt;knitr&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;css&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;CSS&lt;/h3&gt;
&lt;p&gt;The CSS style I have used to display the image:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;img {
        border: 1px;
        border-style: groove;
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px  rgba(0, 0, 0, 0.19);
}

p.caption {
    text-align: center;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
    font-size: smaller;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;summary&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;Using the &lt;code&gt;knitr&lt;/code&gt; function &lt;code&gt;include_graphics()&lt;/code&gt; for external images provides a rich set of image attributes (tags). It is also very flexible, especially if you are using the more complex possibilities like programming the output chunk hook.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: yes (format: &#34;fig:&amp;lt;chunk name&amp;gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: yes (with &lt;code&gt;out.extra&lt;/code&gt;, example: &lt;code&gt;out.extra=&#39;class=&#34;border shadowed&#34;&#39;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: yes (with out.extra, example: &lt;code&gt;out.extra=&#39;style=&#34;background-color: #9ecff7; padding:10px; display: inline-block;&#34;&#39;&lt;/code&gt; See blog post &lt;a href=&#34;http://zevross.com/blog/2017/06/19/tips-and-tricks-for-working-with-images-and-figures-in-r-markdown-documents/&#34;&gt;Tips and tricks for working with images and figures in R Markdown documents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;markdown-via-addins-insert-image&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Markdown via Addins ‘Insert Image’&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;images/adding-external-window-with-rstudio-addin-min.png&#34; /&gt;&lt;/p&gt;
&lt;p&gt;The possibilities of RStudio Addins window for &lt;code&gt;blogdown&lt;/code&gt; are sparse. But it has one big advantage: The addin helps user to provide the correct file path and copies the image to the right place.&lt;/p&gt;
&lt;p&gt;The RStudio Addins window for &lt;code&gt;blogdown&lt;/code&gt; package allows only width / height arguments and alternative text. The content of the ‘alt’-attribute is in the final HTML code converted to the caption, &lt;a href=&#34;https://blog.spotibo.com/difference-between-alt-text-and-title-text/&#34;&gt;which is not correct&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;The alternate text should describe what you can see on the image in case the image does not appear (e.g., is blocked) or the user applies a screen reader. ‘Alt’ text is also rendered by search engines. Every picture should have a corresponding ‘alt’ attribute The caption by contrast is not so important. It provides additional information and appears under the image explaining the content to reader who are able to see the picture.&lt;/p&gt;
&lt;div id=&#34;example-1&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;images/my-image.png&#34; style=&#34;width:100.0%&#34; alt=&#34;&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;&lt;strong&gt;Figure 2:&lt;/strong&gt; Caption for this figure 2&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-warning&#34;&gt;
  &lt;div&gt;
    You can’t use the Addins ‘Insert Image’ in Visual R Markdown mode because it protects the conversion by adding a backslash in front of the squared brackets: &lt;code&gt;![Alt text](images/my-image.png)&lt;/code&gt;.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-markdown&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in markdown&lt;/h3&gt;
&lt;p&gt;RStudio Addins window produces the following markdown code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;![**Figure 2:** Caption for this figure 2](images/my-image.png){width=100%}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I think starting with the RStudio version 1.4 (January 2021) the RStudio Addin window is superseded by the the &lt;a href=&#34;https://rstudio.github.io/visual-markdown-editing/#/&#34;&gt;Visual R Markdown&lt;/a&gt; window (see &lt;a href=&#34;#visual-r-markdown-via-menu-insert&#34;&gt;next section&lt;/a&gt;). If you are turning on the visual editor you can always enhance the rudimentary markdown of the addin window with all the features of Visual R Markdown.&lt;/p&gt;
&lt;p&gt;For this improvement you need to&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;turn on Visual RStudio Markdown;&lt;/li&gt;
&lt;li&gt;select the image which markdown you want to enhance;&lt;/li&gt;
&lt;li&gt;click into the small round button with the three points to open up the dialog window;&lt;/li&gt;
&lt;li&gt;correct or add the desired content for the attributes (there is more under the “Attributes” tab);&lt;/li&gt;
&lt;li&gt;close the window;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want to work with markdown directly you may turn off Visual RStudio Markdown.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;images/enhancing-markdown-with-visual-r-markdown-commented-min.png&#34; alt=&#34;&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;Screenshot of the Visual RStudio Markdown window&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-html-1&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in HTML&lt;/h3&gt;
&lt;p&gt;Here I am referring to the RStudio Addin without enhancement from the Visual R Markdown window.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;
    &amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;&amp;quot;&amp;gt;
    &amp;lt;p class=&amp;quot;caption&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Figure 2:&amp;lt;/strong&amp;gt; Caption for this figure 1           
    &amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see: The &lt;code&gt;alt&lt;/code&gt; attribute is empty, although I have filled it out!&lt;/p&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-note&#34;&gt;
  &lt;div&gt;
    If you do not provide text for the &lt;code&gt;alt&lt;/code&gt; (= capture) attributes then there is no &lt;code&gt;div.figure&lt;/code&gt; and &lt;code&gt;p.caption&lt;/code&gt; class. In this case there is only the &lt;code&gt;img&lt;/code&gt; tag as you can see with the image under the header &lt;a href=&#34;#markdown-via-addins-insert-image&#34;&gt;Markdown via Addins ‘Insert Image’&lt;/a&gt;.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;css-1&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;CSS&lt;/h3&gt;
&lt;p&gt;The conversion to HTML produced exactly the same classes as in the result with the &lt;code&gt;knitr&lt;/code&gt; image inclusion (see the &lt;a href=&#34;#css&#34;&gt;CSS code under the knitr section&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;summary-1&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;visual-r-markdown-via-menu-insert&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Visual R Markdown via Menu ‘Insert …’&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;images/image-dialog-window-side-by-side-min.png&#34; /&gt;&lt;/p&gt;
&lt;p&gt;After you have turned on Visual R Markdown you can load the image window via the Menu &lt;code&gt;&#39;Insert &#39; -&amp;gt; &#39;Image…&#39;&lt;/code&gt; or shortcut ⇧⌘I. For an overview I put in the picture above both parts of the window side by side. You can see that it offers a very complete list of image attributes.&lt;/p&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-warning&#34;&gt;
  &lt;div&gt;
    If you do not include text in the “Caption/Alt” field then no HTML code for the &lt;code&gt;div.figure&lt;/code&gt; and &lt;code&gt;p.caption&lt;/code&gt; classes will be produced and the appropriate CSS styles cannot be applied.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;div id=&#34;example-2&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;images/my-image.png&#34; title=&#34;title text and tooltip&#34; id=&#34;figure3&#34; alt=&#34;here comes a description for blind people, screen readers and search engines&#34; alt=&#34;&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;Figure 3: Caption for this figure&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Even in this enhanced window is the wrong mixture of ‘Caption’ and ‘Alt’ attributes offered. But there is a work around with the ‘Other’-field as I have shown in the screenshot.&lt;/p&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-note&#34;&gt;
  &lt;div&gt;
    Fill in the field “Caption/Alt” &lt;strong&gt;and&lt;/strong&gt; add the &lt;code&gt;alt&lt;/code&gt; attribute in the field “Others”. After the conversion to HTML the former constitutes the caption and the later the alternative text.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;If you click on the inserted image and call the window again, then a slightly different window appears where fields for width and height are added and can be changed. This addition appears under the image as well by just clicking on the image.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;images/width-height-fields-after-image-inclusion-min.png&#34; id=&#34;width-height-added&#34; alt=&#34;Width and height field added after the image was included into the .Rmd page. Left: changed window, right: after click into the inserted window.&#34; alt=&#34;&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;Width and height field added after the image was included into the .Rmd page&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-markdown-1&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in markdown&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;![Figure 3: Caption for this figure](images/my-image.png &amp;quot;title text and tooltip&amp;quot;){#figure3 alt=&amp;quot;here comes a description for blind people, screen readers and search engines}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In addition to the standard markdown code all the other attributes are added inside curly brackets.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-html-2&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in HTML&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;
    &amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; title=&amp;quot;title text and tooltip&amp;quot; id=&amp;quot;figure3&amp;quot;
    alt=&amp;quot;here comes a description for blind people, screen readers and search engines&amp;quot;&amp;gt;
    &amp;lt;p class=&amp;quot;caption&amp;quot;&amp;gt;
        Figure 3: Caption for this figure
    &amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;css-2&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;CSS&lt;/h3&gt;
&lt;p&gt;The conversion to HTML produced exactly the same classes as in the result with the other two methods &lt;a href=&#34;#css&#34;&gt;&lt;code&gt;knitr&lt;/code&gt; image inclusion&lt;/a&gt; and &lt;a href=&#34;#css-1&#34;&gt;Addins ‘Insert Image’&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;summary-2&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): yes&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;hugo-figure-shortcut&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Hugo figure shortcut&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;You cannot simply write {{&amp;lt; shortcode &amp;gt;}} in R Markdown, because Pandoc is not aware of Hugo shortcodes, and may convert special characters so that Hugo can no longer recognize the shortcodes (e.g. &amp;lt; will be converted to &amp;lt;).&lt;a href=&#34;#fn1&#34; class=&#34;footnote-ref&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With &lt;a href=&#34;https://gohugo.io/getting-started/configuration-markup/#blackfriday&#34;&gt;Blackfriday&lt;/a&gt; as default Markdown rendering engine I used to use for shortcodes the &lt;code&gt;blogdown::shortcode()&lt;/code&gt; function. But after Hugo v0.60 the default Markdown rendering engine changed to &lt;a href=&#34;https://gohugo.io/getting-started/configuration-markup/#goldmark&#34;&gt;Goldmark&lt;/a&gt;. In the above quoted man page for the shortcode() function there is a also special note on this issue:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Since Hugo v0.60, Hugo has switched its default Markdown rendering engine to Goldmark. One consequence is that shortcodes may fail to render. You may enable the unsafe option in the configuration file: &lt;a href=&#34;https://gohugo.io/getting-started/configuration-markup/#goldmark&#34; class=&#34;uri&#34;&gt;https://gohugo.io/getting-started/configuration-markup/#goldmark&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I couldn’t understand this remark as for me all the Hugo shortcodes works well. But to apply it more easily I use pure HTML code chunks to prevent a conversion by Pandoc. This has the advantage that I can include Hugo’s shortcode syntax without any changes.&lt;/p&gt;
&lt;div id=&#34;example-3&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Example&lt;/h3&gt;














&lt;figure  id=&#34;figure-shortcut-figure&#34;&gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;
        &lt;img alt=&#34;My alt text&#34; srcset=&#34;
               /2021/05/05/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png 400w,
               /2021/05/05/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_c4c18b47561549b1147ccf6dd152b5f0.png 760w,
               /2021/05/05/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1200x1200_fit_lanczos_2.png 1200w&#34;
               src=&#34;https://notes.peter-baumgartner.net/2021/05/05/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png&#34;
               width=&#34;754&#34;
               height=&#34;226&#34;
               loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;figcaption data-pre=&#34;Figure&amp;nbsp;&#34; data-post=&#34;:&amp;nbsp;&#34; class=&#34;numbered&#34;&gt;
      My caption text
    &lt;/figcaption&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-html-chunk&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in HTML chunk&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;```{=html}
{{&amp;lt; figure src=&amp;quot;images/my-image.png&amp;quot; class=&amp;quot;center&amp;quot; alt=&amp;quot;My alt text&amp;quot; caption=&amp;quot;My title text&amp;quot; id=&amp;quot;shortcut-figure&amp;quot; numbered=&amp;quot;true&amp;quot; &amp;gt;}}
```&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;id&lt;/code&gt; and &lt;code&gt;numbered&lt;/code&gt; attributes are not provided by but they are a &lt;a href=&#34;https://wowchemy.com/docs/content/writing-markdown-latex/#single-image&#34;&gt;feature from the academic theme&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you do not use &lt;code&gt;id&lt;/code&gt; explicitly then Hugo generates an ID with the “figure-” followed by the caption text (e.g., &lt;code&gt;id=&#34;figure-my-caption-text&#34;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;You can see that the numbering systems starts from scratch, e.g., it does not account for the &lt;code&gt;knitr&lt;/code&gt; chunks. The same is true vice versa.&lt;/li&gt;
&lt;li&gt;Besides the already mentioned attributes Hugo also features &lt;code&gt;target&lt;/code&gt;, &lt;code&gt;rel&lt;/code&gt; and attribution (&lt;code&gt;attr&lt;/code&gt; = text; &lt;code&gt;attrlink&lt;/code&gt; = link).&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id=&#34;css-3&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;CSS&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;```{=html}
&amp;lt;figure id=&amp;quot;figure-shortcut-figure&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;d-flex justify-content-center&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;w-100&amp;quot;&amp;gt;
        &amp;lt;img alt=&amp;quot;My alt text&amp;quot; srcset=&amp;quot;
               /post/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png 400w,
               /post/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_c4c18b47561549b1147ccf6dd152b5f0.png 760w,
               /post/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1200x1200_fit_lanczos_2.png 1200w&amp;quot; src=&amp;quot;/post/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png&amp;quot; width=&amp;quot;754&amp;quot; height=&amp;quot;226&amp;quot; loading=&amp;quot;lazy&amp;quot; data-zoomable=&amp;quot;&amp;quot; class=&amp;quot;medium-zoom-image&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;figcaption data-pre=&amp;quot;Figure&amp;amp;nbsp;&amp;quot; data-post=&amp;quot;:&amp;amp;nbsp;&amp;quot; class=&amp;quot;numbered&amp;quot;&amp;gt;
      My caption text
  &amp;lt;/figcaption&amp;gt;
&amp;lt;/figure&amp;gt;

```&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The produced HTML is pretty complex, but here we are just interested in the two relevant tags for CSS styling: &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt;. These two HTML tag are different to the code produced by other methods of inserting images. So maybe it would be a good idea to style both variants the same way.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;summary-3&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: yes (Academic theme)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: no (zoomable)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: yes (Academic theme)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;results-and-conclusion&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Results and Conclusion&lt;/h2&gt;
&lt;table&gt;
&lt;caption&gt;Table: Features of different method of inserting images in Rmd files converting to HTML&lt;/caption&gt;
&lt;colgroup&gt;
&lt;col width=&#34;15%&#34; /&gt;
&lt;col width=&#34;8%&#34; /&gt;
&lt;col width=&#34;8%&#34; /&gt;
&lt;col width=&#34;9%&#34; /&gt;
&lt;col width=&#34;8%&#34; /&gt;
&lt;col width=&#34;51%&#34; /&gt;
&lt;/colgroup&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th align=&#34;center&#34;&gt;knitr&lt;/th&gt;
&lt;th align=&#34;center&#34;&gt;Addin&lt;/th&gt;
&lt;th align=&#34;center&#34;&gt;Visual&lt;/th&gt;
&lt;th align=&#34;center&#34;&gt;Hugo&lt;/th&gt;
&lt;th&gt;Remark&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;Caption&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;C. format&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌ &lt;sup&gt;2&lt;/sup&gt;&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌ &lt;sup&gt;2&lt;/sup&gt;&lt;/td&gt;
&lt;td&gt;&lt;sup&gt;2&lt;/sup&gt; standard = bold&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;C.numbered&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;3&lt;/sup&gt;&lt;/td&gt;
&lt;td&gt;&lt;sup&gt;3&lt;/sup&gt; via ‘Academic’ theme&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;Alt&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;4&lt;/sup&gt;&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;sup&gt;4&lt;/sup&gt; via ‘Other’-field&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;Title&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;Tooltip&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;Width/Height&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;Link to&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;ID&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;5&lt;/sup&gt;&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;6&lt;/sup&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;sup&gt;5&lt;/sup&gt; &lt;code&gt;fig:&amp;lt;chunk name&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;sup&gt;6&lt;/sup&gt; &lt;code&gt;figure-&amp;lt;caption text&amp;gt;&lt;/code&gt; or ‘Academic’ theme&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;CSS&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;Other&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;sup&gt;1&lt;/sup&gt;&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;7&lt;/sup&gt;&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;8&lt;/sup&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt;via output chunk arbitrary HTML code!&lt;/p&gt;
&lt;p&gt;&lt;sup&gt;7&lt;/sup&gt; free choice!&lt;/p&gt;
&lt;p&gt;&lt;sup&gt;8&lt;/sup&gt; &lt;code&gt;target&lt;/code&gt;, &lt;code&gt;rel&lt;/code&gt;, &lt;code&gt;attr&lt;/code&gt;, &lt;code&gt;attrlink&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;If we take into account that code produced by the RStudio Addin window can be improved at any time with the Visual R Markdown window then all the four offered methods are pretty similar. But keep in mind that advantages on the one hand are often counter acted by disadvantages on other areas. So — for instance — provides the conversion via Pandoc many advantages but looses also some features of Hugo or the applied theme.&lt;/p&gt;
&lt;p&gt;To sum up this this little investigation I see three patterns of decisions criteria:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;One big difference is the possibility to number the figures automatically. The Addin and Visual R Markdown windows do not provide this feature.&lt;/li&gt;
&lt;li&gt;On the other hand filling in the window fields is — especially for people who are not so comfortable with HTML or Markdown code — easier.&lt;/li&gt;
&lt;li&gt;Another decision criteria could be consistency: If you are using R chunks (which is the major reason to use the .Rmd format!) and want to be consistent throughout the file, then the decision for the &lt;code&gt;knitr&lt;/code&gt; method is obvious.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But let’s see what the other file format are producing. For people using different methods&lt;a href=&#34;#fn2&#34; class=&#34;footnote-ref&#34; id=&#34;fnref2&#34;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt; for their posts perhaps the comparison inside one file format is not sufficient. Perhaps there is a method not ideal when considered only one file format but has a higher consistency when looked all file format together.&lt;/p&gt;
&lt;span class=&#39;Z3988&#39; title=&#39;url_ver=Z39.88-2004&amp;amp;ctx_ver=Z39.88-2004&amp;amp;rfr_id=info%3Asid%2Fzotero.org%3A2&amp;amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;amp;rft.type=blogPost&amp;amp;rft.title=Images:%20From%20R%20Markdown%20to%20HTML%20format&amp;amp;rft.source=Thought%20splinters&amp;amp;rft.rights=CC%20BY-SA%204.0&amp;amp;rft.description=The%20post%20investigates%20different%20methods%20to%20include%20images%20in%20%60.Rmd%60%20files%20and%20how%20they%20are%20treated%20in%20the%20%60blogdown%60%20conversion%20process%20to%20HTML.&amp;amp;rft.identifier=https%3A%2F%2Fnotes.peter-baumgartner.net%2F2021%2F05%2F05%2Fimages-from-rmd-to-html-format&amp;amp;rft.aufirst=Peter&amp;amp;rft.aulast=Baumgartner&amp;amp;rft.au=Peter%20Baumgartner&amp;amp;rft.date=2021-05-05&amp;amp;rft.language=en&#39;&gt;&lt;/span&gt; 
&lt;/div&gt;
&lt;div class=&#34;footnotes&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn1&#34;&gt;&lt;p&gt;Helper functions to write Hugo shortcodes using the R syntax&lt;a href=&#34;#fnref1&#34; class=&#34;footnote-back&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li id=&#34;fn2&#34;&gt;&lt;p&gt;As with blogdown version 1.3 not all files are automatically rendered, one could choose a different file and conversion format for every post separately. This requires (1) deleting those files produced by the conversion process in the folder of the post under consideration (2) renaming the file ending of the main file and kniting/rendering the new file format again.&lt;a href=&#34;#fnref2&#34; class=&#34;footnote-back&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description>
    </item>
    
  </channel>
</rss>
