我正在使用RStudio来编写markdown文档,并希望在文档顶部添加目录(TOC),以便用户可以单击相关部分进行阅读.关于rpubs有一些相关的例子,但现在我似乎无法找到它们.请注意,我不使用pandoc和很新的Rmd&knitr.有没有办法在不使用的情况下添加TOC pandoc?如果pandoc必须使用哪些功能是相关的?
这是一个小样本页面:
---
title: "Sample Document"
output:
html_document:
toc: true
theme: united
---
Header 1
---------------
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>.
## Header 2
When you click the **Knit** button a document will be generated that includes both content as well as the output of …Run Code Online (Sandbox Code Playgroud) 任何人都可以指出使用的优点HM?C是什么?
例如,如果我有文本T和密钥K,我可以使用任一HMAC-MD5算法或Md5(T + K)获取签名.
如何在rmarkdown beamer演示文稿的新行中添加作者联盟?
---
title: "This is the title"
author: "Author"
date: "Thursday, April 09, 2015"
output: beamer_presentation
---
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
Run Code Online (Sandbox Code Playgroud)
欲望标题幻灯片应该是
这是标题
作者
联系
2015年4月9日,星期四
我是Knitr的新手.我正在尝试使用r块进行报告,我无法弄清楚如何使用标题和标签来引用该图.这是我想做的一个例子:
---
title: "Plotting"
author: "xx"
date: '2015-08-10'
output: pdf_document
---
```{r figs, echo=FALSE, fig.width=7,fig.height=6,fig.cap="plotting example"}
par(mfrow=c(2,2))
plot(1:10, col=2)
plot(density(runif(100, 0.0, 1.0)))
plot(runif(100, 0.0, 1.0),type="l")
```
in Figure \ref{fig:figs} we see examples of plotting in R.
Run Code Online (Sandbox Code Playgroud)
我想有一个标题"绘图示例",并有一个标签,所以我可以在文本中使用Figure\ref {fig.label}.我试过fig.cap和fig.lp,它们都没有用.如果有人可以提供帮助,我将不胜感激.
axis.ticks.margin在ggplot2 2.0中使用时,我收到了一条警告消息:
axis.ticks.margin已弃用.请设置margin属性axis.text.
我以为我可以尝试,axis.text.margin但我得到另一个警告说这是一个无效的功能.发行说明说:
主题设置
axis.ticks.margin已被弃用:现在使用axis.ticks的margin属性.
那么现在保证金设定在哪里?
我有一个文本文件,我这样读:
file=read.table("file.txt",skip="1",sep="")
Run Code Online (Sandbox Code Playgroud)
该文本文件的第一行包含有关该文件的信息,然后是观察结果.
我想提取第一行并将其写入新的文本文件.
我有一个像这样的数据框"DF":
Flight.Start Flight.End Device Partner Creative Days.in.Flight
2015-08-31 2015-08-31 Standard MSN Video 35
Run Code Online (Sandbox Code Playgroud)
我需要做的是"吹嘘",如下:
Flight.Start Flight.End Date Device Partner Creative Days.in.Flight
2015-08-31 2015-10-04 2015-08-31 Standard MSN Video 35
2015-08-31 2015-10-04 2015-09-01 Standard MSN Video 35
2015-08-31 2015-10-04 2015-09-02 Standard MSN Video 35
2015-08-31 2015-10-04 2015-09-03 Standard MSN Video 35
2015-08-31 2015-10-04 2015-09-04 Standard MSN Video 35
2015-08-31 2015-10-04 2015-09-05 Standard MSN Video 35
2015-08-31 2015-10-04 2015-09-06 Standard MSN Video 35
2015-08-31 2015-10-04 2015-09-07 Standard MSN Video 35
Run Code Online (Sandbox Code Playgroud)
ETC ......直到Date变量达到2015-10-04,然后继续下一个重复
基本上每一行都会被 …
我想创建一个简单的表,展示我的数据集中给定变量的最大10个值,以及每个观察的4个其他变量,所以基本上是我的数据的一小部分.它看起来像这样:
Score District Age Group Gender
17 B 23 Red 1
12 A 61 Red 0
11.7 A 18 Blue 0
10 B 18 Red 0
.
.
etc.
Run Code Online (Sandbox Code Playgroud)
从而在Score var上对数据进行排序.所有数据都包含在同一数据帧中.
当我绘制具有相同颜色的点和文本时,a图例中的形状和形状重叠.
我可以告诉ggplot不要a在图例中画出来吗?怎么样?
M <- data.frame(t=letters[1:16],
xx=runif(16),
yy=runif(16),
g=rep(c("A","B","C","D"),4))
str(M)
ggplot(M,aes(x=xx,y=yy,label=t,colour=g)) +
geom_point(shape=3) +
geom_text(vjust=0,hjust=0) +
scale_colour_discrete()
Run Code Online (Sandbox Code Playgroud)

我有包含两列time且timezone具有事件时间戳的数据。例子是:
time timezone
1433848856453 10800000
Run Code Online (Sandbox Code Playgroud)
似乎时间戳在信息中也有小数秒。我不明白时区格式,但它必须是等效的 unix 格式。我也需要保留小数秒。我如何从那个变成类似 R 的东西?
2015-01-01 13:34:56.45 UTC
Run Code Online (Sandbox Code Playgroud)
注意:这个人类可读的日期不是显示的 unix 时间戳的实际转换值。