我正在尝试将 .Rmd 文件转换为 .md(输出:md_document),但标题未显示在呈现的文件中。
当我尝试呈现与 .html 文件相同的文件时,标题确实出现了(输出:html_document)。
标题显示在渲染的文档上:
---
title: "Test"
output: html_document
---
```{r}
head(cars)
```
Run Code Online (Sandbox Code Playgroud)
标题未显示在呈现的文档上:
---
title: "Test"
output: md_document
---
```{r}
head(cars)
```
Run Code Online (Sandbox Code Playgroud)
rmarkdown::render(my_file)
Run Code Online (Sandbox Code Playgroud)
任何想法为什么?
我在 Mac 10.9.5 上使用 RStudio 0.98.1091 和 R 3.1.2。
中间的代码--被解释,因为我的引用是用以下代码呈现的:
---
title: "Test"
output: md_document
bibliography: ~/mybib.bib
---
This is a test where I cite [@post1, @post2]
Run Code Online (Sandbox Code Playgroud)
有趣的是,当我要求生成 html 和 md 文件时,标题显示在 .md 文件中:
---
title: "Test"
output:
html_document:
keep_md: yes
---
Run Code Online (Sandbox Code Playgroud)
的输出不keep_md: yes应该与output: md_document?
有没有一种方法可以从命令行创建R演示文稿?
https://support.rstudio.com/hc/zh-CN/articles/200486468-Authoring-R-Presentations
我在文件中存储了以下R Presentation my_file.RPres文件。
Title
========================================================
author: Me
date: Jan 9, 2015
transition: none
css: template.css
This is my presentation.
Run Code Online (Sandbox Code Playgroud)
有什么办法来指定rmarkdown::render(),knit(),pandoc(),或者其他R指令,这是一个“R演示” .RPres文件,而不是 ioslides_presentation,beamer_presentation或slidy_presentation?
我的.RPres文件的头上没有任何YAML元数据,并且该.css文件是基于RStudio生成的带有“ Preview”和“另存为网页...”的html文件创建的。
我有这个代码:
library(magrittr)
a <- function(cars) return(cars)
b <- function(x) return(list(varname = deparse(substitute(x)), content = x))
Run Code Online (Sandbox Code Playgroud)
b(cars)返回包含字符串cars和data.frame内容的列表cars.
还有什么方法a(cars) %>% b()可以返回字符串cars(函数返回的变量的名称a())和data.frame的内容?
相反,它返回.data.frame的内容.
也就是说,我希望第二个函数返回第一个函数返回的变量的名称以及变量的内容.
我真正想要做的b()就是这样write.csv(x, paste0(deparse(substitute(x)), ".csv")).
有什么建议?