learning_R

R markdown笔记05-knitr03

2021-02-02  本文已影响0人  ks_c

@[toc]( <center> knitr翻译03)


title: "Untitled"
author: "ks_c"
date: "2021/2/1"
output: html_document



Code chunk

  1. code: (NULL; character) If provided, it will override the code in the current chunk. This allows us to programmatically insert code into the current chunk. For example, code = readLines('test.R') will use the content of the file test.R as the code for the current chunk.
    NULL;字符)如果提供,它将覆盖当前块中的代码。 这使我们能够以编程方式将代码插入当前块中。 例如,code = readLines('test.R')将使用test.R文件的内容作为当前块的代码。

  2. ref.label: (NULL; character) A character vector of labels of the chunks from which the code of the current chunk is inherited (see the demo for chunk references).
    NULL; character)当前块代码是来自哪个块的标签,字符向量

Child documents

Language engines

knitr::opts_chunk$set(engine.path = list(
python = '~/anaconda/bin/python',
ruby = '/usr/local/bin/ruby'
))

The names of the list correspond to the names of the engines.

Option templates

opts.label: (NULL; character) The label of options set in knitr::opts_template (see ?knitr::opts_template). This option can save some typing effort for sets of frequently used chunk options.

Extracting source code

purl: (TRUE; logical) When running knitr::purl() to extract source code from a source document, whether to include or exclude a certain code chunk.

Other chunk options

R.options: (NULL; list) Local R options for a code chunk. These options are set temporarily via options() before the code chunk, and restored after the chunk.

上一篇下一篇

猜你喜欢

热点阅读