[education/rkward] rkward: tables for knitr improved and xtable added

Stefan Rödiger null at kde.org
Tue Jun 21 23:13:50 BST 2022


Git commit c0126a1b7887a07fb49bb4a40db071835faa1e93 by Stefan Rödiger.
Committed on 21/06/2022 at 22:12.
Pushed by srodiger into branch 'master'.

tables for knitr improved and xtable added

M  +8    -8    rkward/RKWardRMd.xml

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

diff --git a/rkward/RKWardRMd.xml b/rkward/RKWardRMd.xml
index e18c8e7d..8e1f595d 100644
--- a/rkward/RKWardRMd.xml
+++ b/rkward/RKWardRMd.xml
@@ -181,7 +181,7 @@ A & B \\
  </item>
  <item>
   <match>Code (chunk with defaults)</match>
-  <fillin>${rangeCommand("\n```"+ braces("r, chunk-label, echo = FALSE, eval = TRUE, fig.show = \"asis\", include = TRUE, message = FALSE, results = \"asis\", warning = FALSE") +" %%1```\n", "\nx <- 1\n\n")}</fillin>
+  <fillin>${rangeCommand("```"+ braces("r, chunk-label, echo = FALSE, eval = TRUE, fig.show = \"asis\", include = TRUE, message = FALSE, results = \"asis\", warning = FALSE") +" %%1```\n", "\nx <- 1\n\n")}</fillin>
  </item>
  <item>
   <match>Table</match>
@@ -205,14 +205,14 @@ A & B \\
   </fillin>
  </item>
  <item>
-  <match>Table (kable)</match>
-  <fillin>
-```{r}
-data <- iris[1:4, ]
-knitr::kable(data, caption = "Table caption text.")
-```
+  <match>Table (knitr)</match>
+  <fillin>${rangeCommand("```"+ braces("r, chunk-label, echo = FALSE, eval = TRUE, include = TRUE, message = FALSE, results = \"asis\", warning = FALSE") +"\nknitr::kable(%%1, caption = \"Table caption text.\")\n```", "data")}
   </fillin>
  </item>
+ <item>
+  <match>Table (xtable)</match>
+  <fillin>${rangeCommand("```"+ braces("r, chunk-label, echo = FALSE, eval = TRUE, include = TRUE, message = FALSE, results = \"asis\", warning = FALSE") +"\nprint(xtable::xtable(%%1), comment = FALSE)\n```", "data")}</fillin>
+ </item>
  <item>
   <match>YAML header</match>
     <fillin>---
@@ -445,7 +445,7 @@ Please feel free to adjust it to your needs.
 
 \pagebreak
 
-```{r, chunk-label, echo=FALSE, include=FALSE}
+```{r, echo=FALSE, include=FALSE}
 # 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())


More information about the rkward-tracker mailing list