我有所有以“ m”开头的列名称。例子:mIncome, mAge。我想删除prefix. 到目前为止,我已经尝试了以下方法:
df %>%
rename_all(~stringr::str_replace_all(.,"m",""))
Run Code Online (Sandbox Code Playgroud)
这将删除所有包含字母“ ”的列名称m。我只需要从一开始就将其删除。有什么建议么?
我想同时拥有:浮动目录和报告开头的目录(在 Rmarkdown 中)。我认为只有一个是可能的。
在这里,我手动添加了一个目录。
---
title: "Report"
author: "Anon"
date: '2022-07-20'
output:
html_document:
toc: true
toc_float: true
toc_depth: 2
collapsed: true
smooth_scroll: true
---
## Table of Contents
- R Markdown
- Including Plots
## 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 …Run Code Online (Sandbox Code Playgroud)