[education/rkward] rkward: pipe and function added to R snipptes, R Markdown linebreaks improved

Stefan Rödiger null at kde.org
Mon Jun 20 09:15:32 BST 2022


Git commit f215d6407052b16148ad3bdfd30181da98ff94b8 by Stefan Rödiger.
Committed on 20/06/2022 at 08:14.
Pushed by srodiger into branch 'master'.

pipe and function added to R snipptes, R Markdown linebreaks improved

M  +26   -0    rkward/RKWardR.xml
M  +6    -3    rkward/RKWardRMd.xml

https://invent.kde.org/education/rkward/commit/f215d6407052b16148ad3bdfd30181da98ff94b8

diff --git a/rkward/RKWardR.xml b/rkward/RKWardR.xml
index 505fe70e..b15495ce 100644
--- a/rkward/RKWardR.xml
+++ b/rkward/RKWardR.xml
@@ -50,6 +50,32 @@ par(mf­row­=c(­3,3))
 %*%
   </fillin>
  </item>
+ <item>
+  <match>Function</match>
+  <fillin>
+f <- function(x) sqrt(x%*%x)
+# To test the function run
+# f(1:4)
+  </fillin>
+ </item>
+ <item>
+  <match>Determines an object's base type</match>
+  <fillin>
+  <fillin>${rangeCommand("typeof(%%1)", "Object")}</fillin>
+  </fillin>
+ </item>
+ <item>
+  <match>pipe (native)</match>
+  <fillin>
+    <fillin> |> </fillin>
+  </fillin>
+ </item>
+ <item>
+  <match>pipe (pseudo)</match>
+  <fillin>
+    <fillin> ->.; </fillin>
+  </fillin>
+ </item>
  <item>
   <match>Concat­enate character vectors</match>
   <fillin>
diff --git a/rkward/RKWardRMd.xml b/rkward/RKWardRMd.xml
index 9050b181..a4f95a45 100644
--- a/rkward/RKWardRMd.xml
+++ b/rkward/RKWardRMd.xml
@@ -56,6 +56,10 @@ function rangeCommand(command, def) {
   <match>Bold</match>
   <fillin>${rangeCommand("**%%1**", "Bold")}</fillin>
  </item>
+ <item>
+  <match>Text comment (HTML)</match>
+  <fillin>${rangeCommand("<--!*%%1*-->", "Text")}</fillin>
+ </item>
  <item>
   <match>Italics</match>
   <fillin>${rangeCommand("*%%1*", "Italics")}</fillin>
@@ -178,8 +182,7 @@ knitr::opts_chunk$set(
  </item>
  <item>
    <match>RMarkdown template</match>
-   <fillin>
----
+   <fillin>---
 title: "Document title"
 author: "The RKWard Team"
 date: "`r Sys.Date()`"
@@ -300,6 +303,6 @@ for (i in 1:4) {
 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>
+</fillin>
  </item>
 </snippets>


More information about the rkward-tracker mailing list