[education/rkward/snippets] rkward: Rmarkdown template added

Stefan Rödiger null at kde.org
Sun Jun 19 21:35:15 BST 2022


Git commit 65456b069f981dfe7ad1ec8969630b462369e732 by Stefan Rödiger.
Committed on 19/06/2022 at 20:34.
Pushed by srodiger into branch 'snippets'.

Rmarkdown template added

M  +131  -1    rkward/RKWardRMd.xml

https://invent.kde.org/education/rkward/commit/65456b069f981dfe7ad1ec8969630b462369e732

diff --git a/rkward/RKWardRMd.xml b/rkward/RKWardRMd.xml
index 03fc1531..a2f93c3f 100644
--- a/rkward/RKWardRMd.xml
+++ b/rkward/RKWardRMd.xml
@@ -94,7 +94,7 @@ $$e^${braces("i\\pi")} + 1$$
  </item>
  <item>
   <match>Link</match>
-  <fillin>${rangeCommand("(title)[%%1]", "URL")}</fillin>
+  <fillin>${rangeCommand([title]"(%%1)", "URL")}</fillin>
  </item>
  <item>
   <match>rmarkdown::render()</match>
@@ -172,4 +172,134 @@ knitr::opts_chunk$set(
 ```
     </fillin>
  </item>
+ <item>
+  <match>Footnote</match>
+  <fillin>^[${cursor}This is a footnote.]</fillin>
+ </item>
+ <item>
+   <match>RMarkdown template</match>
+   <fillin>
+---
+title: "Document title"
+author: "The RKWard Team"
+date: "`r Sys.Date()`"
+output:
+    html_document:
+      fig_caption: yes
+      highlight: kate
+      number_sections: yes
+      toc: yes
+      toc_float: true
+      toc_collapsed: true
+number_sections: true
+---
+
+<!--
+This is an example how to create an R Markdown document in RKWard.
+
+The structure of such documents is always the same.
+1. The YAML header between the  ---
+2. An optional Global Settings chunck
+3. The main text containing markdown, LaTeX, R (even other languages like python), HTML and other elements
+
+In this template we show main concept of markdown like
+- heading
+- footnotes
+- links
+- equations
+- lists (ordered, unordered, nested)
+- plots and
+- tables
+Please feel free to adjust it to your needs.
+-->
+
+```{r, echo=TRUE}
+# Defaults to suppress warnings and messages
+# Figure height and width are set to 7 inches
+# See more options by running str(knitr::opts_chunk$get())
+
+knitr::opts_chunk$set(
+  echo = FALSE, error = FALSE, warnings = FALSE, message = FALSE,
+  collapse = FALSE, fig.width = 4, fig.height = 4
+)
+```
+
+# The RKWard IDE and GUI
+
+RKWard is an *easy to use* and **easily extensible** IDE/GUI^[IDE: Integrated Development Environment. GUI: Graphical User Interface] for [R](https://www.r-project.org/). It aims to combine the power of the R-language with the ease of use of commercial statistics tools.
+
+## Features of RKWard
+
+RKWard’s features include:
+
+- Spreadsheet-like data editor
+- Syntax highlighting, code folding and code completion
+- Data import (e.g. SPSS, Stata and CSV)
+- Plot preview and browsable history
+- R package management
+- Workspace browser
+- GUI dialogs for all kinds of statistics and plots
+- Developer tools integration via kateparts
+  - git
+  - terminal tool view (Linux only)
+  - Text filter
+
+and many more features.
+
+## Data handling
+
+RKWard can handle all kinds of data from simple to complex. Here is an example where a part of the iris data is shown as table.
+
+```{r}
+data <- iris[1:4, ]
+knitr::kable(data, caption = "Table caption text.")
+```
+
+It is also possible to make tables by hand as shown next.
+
+
+| Right  | Left  | Default   | Center    |
+|-------:|:------|-----------|:---------:|
+| 12     | 12    | 12        | 12        |
+| 123    | 123   | 123       | 123       |
+| 1      | 1     | 1         | 1         |
+:Example for a handmade table (pure `markdown`)
+
+
+### Plotting in RKWard
+
+There many ways to to plots in RKWard. These are for example:
+
+1. via the GUI menus (e.g., barplot, boxplot, ...)
+2. via the R script and the preview or
+3. in a R Markdown document as shown next.
+
+Let us take a simple code to make four plots of random data in a single row, for example:
+
+
+```
+par(mfrow = c(2,2))
+
+for (i in 1:4) {
+ plot(rnorm(10))
+}
+```
+
+If we put the code in the following R Markdown chunk (note the 'r' in the curly braces) the plot looks as follows:
+
+```{r}
+par(mfrow = c(1,2))
+
+for (i in 1:4) {
+ plot(rnorm(10))
+}
+```
+
+# Conclusion
+
+RKWard is a useful tool. This RKWard version is used with the R version `r  getRversion()`.
+
+If you like RKWard consider to donate. Some small amount for a cup of coffee or a cup of H~2~O is totally fine.
+   </fillin>
+ </item>
 </snippets>


More information about the rkward-tracker mailing list