Rmarkdown生成PDF的模板

---
title: "HUMAN"
author: "MLP"
date: "`r Sys.Date()`"
output:
  pdf_document: 
    latex_engine: xelatex
    extra_dependencies:
      ctex: UTF8
    number_sections: yes
    df_print: kable
    toc: yes
classoptions: "hyperref, 12pt, a4paper"
---

注意:

echo=FALSE,会将代码不输出,而只是输出代码运行的结果
warning=FALSE, message = FALSE表示不输出警告信息(否则有时候虽然代码运行成功,但是会生成的PDF上有一堆警告信息感觉也很烦)

knitr::opts_chunk$set(echo = FALSE,warning = FALSE, message = FALSE) 

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)

Including Plots

You can also embed plots, for example:

plot(pressure)

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.
第 10 章 可重复性文档 | 数据科学中的 R 语言 (bookdown.org)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。