r - R-Markdown 不再编织
问题描述
在过去的几年里,我用我在 R 上的笔记创建了一个广泛的降价文件。今天它不再正确编织,也没有一个备份版本正确编织。输出是正确输出和代码列表之间的交叉;有时以## 为前缀。
---
title: 'The R Companion'
fontsize: 11pt
toc: true
toc_depth: 4
geometry: "top = 2cm, bottom = 1.5cm, left = 2cm, right = 1.5cm"
output: pdf_document
---
\pagebreak
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(tidy.opts=list(width.cutoff=60),tidy=TRUE)
knitr::opts_chunk$set(fig.height = 3.5, fig.width = 7)
library(readr)
library(ggplot2)
library(knitr)
library(kableExtra)
library(lubridate)
library(dplyr)
library(tibble)
library(ggthemes)
library(RColorBrewer)
```
###Basic Data Manipulation
####Vector creation
```{r}
a <- 1:5
b <- 6:10
c <- append(a,b)
print(c)
# Append after c[4].
append(c, 4.5, after=4)
# Append before c[0].
append(c, c(-1, 0), after = 0)
```
输出(下图)只有 15 个 TOC 列表中的两个,标题尚未编织,输出不完整/错误。RStudio 1.2.1335、R 3.6.0.、Rmarkdown 1.12。谢谢。
The R Companion
Contents
Creating and tidying data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 GraphicsI:Plot,axes,titleandlegend. .............................. 20
1
###Basic Data Manipulation ####Vector creation
## [1] 1 2 3 4 5 6 7 8 910
## [1] 1.0 2.0 3.0 4.0 4.5 5.0 6.0 7.0 8.0 9.0 10.0
## [1] -1 0 1 2 3 4 5 6 7 8 9 10
解决方案
尝试安装 formatR 包。在我安装它之前它对我不起作用。我刚刚运行了您的代码,这是我在 word doc knit 中得到的输出。这是你想要的?
The R Companion
Basic Data Manipulation
Vector creation
a <- 1:5
b <- 6:10
c <- append(a, b)
print(c)
## [1] 1 2 3 4 5 6 7 8 9 10
# Append after c[4].
append(c, 4.5, after = 4)
## [1] 1.0 2.0 3.0 4.0 4.5 5.0 6.0 7.0 8.0 9.0 10.0
# Append before c[0].
append(c, c(-1, 0), after = 0)
## [1] -1 0 1 2 3 4 5 6 7 8 9 10
推荐阅读
- c++ - VK_NULL_HANDLE 始终为 0;为什么不是 nullptr?
- qt - QML:在非兄弟姐妹上显示对象
- filemaker - 如何过滤要在“发送电子邮件”脚本步骤中使用的电子邮件地址
- django - 即使在创建帖子期间使用 Postman 将文件上传到该字段后,Django Rest Framework 仍显示字段错误
- ionic-framework - readAsDataUrl 函数没有输出
- flutter - 如何将变换矩阵添加到容器中的 LinearGradient?
- python - 与 NLP 匹配的字符串
- sql - 如何在 Hive 中替换字符串
- linux - 从 NASM 调用 Linux 中断 5
- powershell - Powershell - 将字符串中的非英文字母替换为英文字母