[education/rkward/snippets] rkward: Formatting and minor additions
Thomas Friedrichsmeier
null at kde.org
Sun Jun 19 08:33:08 BST 2022
Git commit 2e66397b0211b95cd1f64075834e27a571dece93 by Thomas Friedrichsmeier.
Committed on 19/06/2022 at 07:33.
Pushed by tfry into branch 'snippets'.
Formatting and minor additions
M +18 -9 rkward/RKWardR.xml
https://invent.kde.org/education/rkward/commit/2e66397b0211b95cd1f64075834e27a571dece93
diff --git a/rkward/RKWardR.xml b/rkward/RKWardR.xml
index 88fdfd5b..84571b9a 100644
--- a/rkward/RKWardR.xml
+++ b/rkward/RKWardR.xml
@@ -50,36 +50,45 @@ par(mfrow=c(3,3))
</fillin>
</item>
<item>
- <match>Concatenate vectors after converting to character</match>
+ <match>Concatenate character vectors</match>
<fillin>
-paste(…, sep = " ", collapse = NULL)
+paste({cursor}, sep = " ", collapse = NULL)
</fillin>
</item>
<item>
- <match>for loop</match>
+ <match>for loop (indexed)</match>
<fillin>
# Print for 10 capital LETTERS
-for(i in 1:10){
+for(i in 1:10) {
print(LETTERS[i])
+}
+ </fillin>
+ </item>
+ <item>
+ <match>for loop (vector based)</match>
+ <fillin>
+# Print for 10 capital LETTERS
+for(l in LETTERS[1:10]) {
+ print(l)
}
</fillin>
</item>
<item>
<match>while loop</match>
<fillin>
-while(condition){
+while (condition) {
Do something
}
</fillin>
</item>
<item>
- <match>ifelse statement</match>
+ <match>if/else statement</match>
<fillin>
-if (condition){
+if (condition) {
Do something
- } else {
+} else {
Do something different
- }
+}
</fillin>
</item>
</snippets>
More information about the rkward-tracker
mailing list