Rmarkdown在bash块中使用sudo
我正在使用{bash}标记尝试一个简单的Rmarkdown文档 我需要用Rmarkdown在bash块中使用sudo,bash,r-markdown,Bash,R Markdown,我正在使用{bash}标记尝试一个简单的Rmarkdown文档 我需要用sudo 显然,降价引擎无法完成此任务 知道如何将sudo密码传递给降价文档吗 提前谢谢你的帮助 遵循可复制的示例 --- title: "test" author: "Andrea" date: "9/15/2020" output: html_document --- ```{r setup, include=FALSE} knitr::opts_c
sudo
显然,降价引擎无法完成此任务
知道如何将sudo密码传递给降价文档吗
提前谢谢你的帮助
遵循可复制的示例
---
title: "test"
author: "Andrea"
date: "9/15/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
text here
```{bash}
ls
```
```{bash}
sudo su
ls
```
也许我有个解决办法 打开终端并使用sudo发出任何命令:即
sudo pwd
比跑
R -e "rmarkdown::render('test.Rmd',output_file='test.html')"
这回答了你的问题吗?(例如,类似于
system(“sudo-ks ls”,input=password)
不是真的,我在一个RMarkdown文档中。此外,我只想为我使用sudo的每个区块键入一次sudo pwd