Mara Averick shows how to create a custom code snippet in RStudio:
The RStudio Support Code Snippets post is a great step-by-step for adding snippets of your own. The gist of it for a markdown snippet is as follows:
-
Open RStudio Preferences
-
Go to the Code section
-
Click the Edit Snippets button3
-
Select Markdown
-
Add your snippet and Save
Click through for a demo of how to embed tweets into your RMarkdown documentation.