m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Chrzanowski <m@m-chrzan.xyz>2021-03-06 12:35:56 +0100
committerMarcin Chrzanowski <m@m-chrzan.xyz>2021-03-06 12:35:56 +0100
commit316487ffb821edf6cd3c47990a812972c0de84a5 (patch)
treefc9295827e048ea18d54f119d72e0b524f889b90
parentbce91cf81c954b4f3e520aef3a850417d7c58e42 (diff)
Add R sheet
-rw-r--r--R.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/R.md b/R.md
new file mode 100644
index 0000000..07382bf
--- /dev/null
+++ b/R.md
@@ -0,0 +1,31 @@
+# R and R Markdown
+
+## Installing packages
+
+In R shell:
+
+ install.packages(<package name>)
+
+## Include a file
+
+ source('<filename>')
+
+## Compiling R Markdown
+
+ require(rmarkdown)
+ render('<filename>') # defaults to HTML
+ render('<filename>' output_format='pdf_document')
+
+## R Markdown
+
+Run R code:
+
+ ```{r}
+ <code>
+ ```
+
+Run code but don't show code block:
+
+ ```{r, echo = False}
+ <code>
+ ```