2020-10-21, Wednesday
发现一个神奇功能,可以用Markdown格式让R code可以直接复制。
(于是神奇的用完了今天简书更新次数:每天只能发布2篇、每篇只能更新5次/日),静静等待过了0点再发文。。。奇葩)
-
选择Markdown编辑器
image.png -
输入这样的符号
image.png
就会带框框,且读者可以直接复制R代码,像这样:
image.png - 高亮一些重点词,输入这样的符号:
就会用特殊格式高亮,像这样:
summary(cars$dist)
summary(cars$speed)
There were `r nrow(cars)` cars studied
There were `r nrow(cars)` cars studied
### There were `r nrow(cars)` cars studied
### There were `r nrow(cars)` cars studied
There were r nrow(cars)
cars studied
Markdown Quick Reference
R Markdown is an easy-to-write plain text format for creating dynamic documents and reports. See Using R Markdown to learn more.
Emphasis
italic bold
italic bold
Headers
Header 1
Header 2
Header 3
Lists
Unordered List
- Item 1
- Item 2
- Item 2a
- Item 2b
Ordered List
- Item 1
- Item 2
- Item 3
- Item 3a
- Item 3b
Manual Line Breaks
End a line with two or more spaces:
Roses are red,
Violets are blue.
Links
Use a plain http address or add a link to a phrase:
linked phrase
Images
Images on the web or local files in the same directory:
[图片上传失败...(image-c674f0-1620230207698)]
[图片上传失败...(image-3039e3-1620230207698)]
Blockquotes
A friend once said:
It's always better to give
than to receive.
R Code Blocks
R code will be evaluated and printed
summary(cars$dist)
summary(cars$speed)
Inline R Code
There were r nrow(cars)
cars studied
Plain Code Blocks
Plain code blocks are displayed in a fixed-width font but not evaulated
This text is displayed verbatim / preformatted
Inline Code
We defined the add
function to
compute the sum of two numbers.
LaTeX Equations
Inline Equation
Display Equation
Horizontal Rule / Page Break
Three or more asterisks or dashes:
Tables
First Header | Second Header |
---|---|
Content Cell | Content Cell |
Content Cell | Content Cell |
Reference Style Links and Images
Links
A linked phrase.
At the bottom of the document:
Images
At the bottom of the document:
Miscellaneous
superscript2
subscript2
strikethrough
Typographic Entities
ASCII characters are transformed into typographic HTML entities:
Straight quotes ( " and ' ) into “curly” quotes
Dashes (“--” and “---”) into en- and em-dash entities
Three consecutive dots (“...”) into an ellipsis entity