19 ```{r include = FALSE}
20 knitr::opts_chunk$set(echo = FALSE)
35 ##### 标题五 缩进两格的1.1.1.1.1
37 `ctexrep`模式下有chapter。标题页后自动分页。
39 `ctexart`模式下从标题一开始,不能使用`\chapter`。可以用`\newpage`手动分页。
41 TeX的格式可以参见<http://mirrors.ibiblio.org/CTAN/language/chinese/ctex/ctex.pdf>。
46 rmarkdown::render('20200517rep.Rmd',output_format='all',output_dir='./out')
49 需要R包:`library(rmarkdown)`与`library(rticles)`。
52 SNP标记匹配结果如表 1.1。【(ref:tables-Result)引用好像用不了,就直接用顺序编号了。】
55 myResult=read.csv('20200517rep.csv', colClasses=c(身份证号='character'))
56 #myResult=read.csv('20200517rep.csv', colClasses='character')
57 knitr::kable(myResult, caption = 'SNP标记匹配结果表')
60 ```{r eval=FALSE, echo = TRUE}
61 write.csv(myResult,'t.csv',row.names=F)
62 tt=read.csv('t.csv', colClasses=c(身份证号='character'))
63 write.csv(tt,'t2.csv',row.names=F)
68 "Rank","身份证号","相同标记数","不同标记数","未覆盖标记数","似然比"
69 1,"888888777777771111",6,11,3,0.95
70 2,"111111222222223333",7,22,4,0.91
71 3,"111111444444442222",8,33,5,0.87
72 4,"13233423",9,44,6,0.83
73 5,"3242434234",10,55,7,0.79
79 apt install r-base-core r-cran-tcltk2 pandoc
80 apt install texlive-latex-recommended texlive-latex-extra
81 apt install texlive-xetex texlive-lang-chinese
87 * 文字部分找人写好,图片“inc/CODIS-and-Chromosome-Loc.jpg”需要更换成57个SNP的。
88 * 使用R脚本生成”20200517rep.csv“文件,“20200517rep.Rmd”的内容相对固定,可以考虑直接`printf()`出来。
89 * 然后,R脚本执行`rmarkdown::render('20200517rep.Rmd',output_format='all',output_dir='./out')`,就可以生成pdf版与网页版了。
97 ```{r, out.width='75%', fig.align='center', fig.cap='STR标记位置图'}
98 knitr::include_graphics('inc/CODIS-and-Chromosome-Loc.jpg')
104 write.csv(iris[1:5, ],file='tmp.csv')
107 write.csv(iris[1:5, ],file='tmp.csv')
108 xx=read.csv('tmp.csv')
118 (ref:cool-plot) A boxplot of the data `iris` in **base** R.
120 ```{r cool-plot, fig.cap='(ref:cool-plot)'}
121 boxplot(Sepal.Length ~ Species, data = iris)
124 ```{r message = FALSE, warning = FALSE}
128 The code below demonstrates the Magma palette in the [viridis](https://github.com/sjmgarnier/viridis) package. It displays a contour map of the Maunga Whau volcano in Auckland, New Zealand.
132 ```{r fig.cap = "The Maunga Whau volcano, Auckland."}
133 image(volcano, col = viridis(200, option = "A"))
143 knitr::kable(iris[1:5, ], caption = 'A caption')