/usr/lib/R/site-library/knitr/doc/knitr-html.Rhtml is in r-cran-knitr 1.15.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | <!DOCTYPE html>
<html>
<!--
%\VignetteEngine{knitr::knitr}
%\VignetteIndexEntry{An R HTML Vignette with knitr}
-->
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body,td{width:800px;margin:auto;}
</style>
<title>An R HTML vignette with knitr</title>
</head>
<!--begin.rcode setup, include=FALSE
library(knitr)
# to base64 encode images
opts_knit$set(upload.fun = image_uri)
end.rcode-->
<body>
<p>This is an R HTML vignette. The file extension is <code>*.Rhtml</code>, and
it has to include a special comment to tell R that this file needs to be
compiled by <strong>knitr</strong>:</p>
<pre><!--
%\VignetteEngine{knitr::knitr}
%\VignetteIndexEntry{The Title of Your Vignette}
-->
</pre>
<p>Now you can write R code chunks:</p>
<!--begin.rcode cars-demo
summary(cars)
fit=lm(dist~speed, data=cars)
summary(fit)
end.rcode-->
<p>You can also embed plots, for example:</p>
<!--begin.rcode cars-plot, fig.width=7, fig.height=6, fig.align='center'
par(mar=c(4,4,.1,.1))
plot(cars, pch=19)
end.rcode-->
<p>For package vignettes, you need to encode images in base64 strings using the
<code>knitr::image_uri()</code> function so that the image files are no longer
needed after the vignette is compiled. For example, you can add this chunk in
the beginning of a vignette:</p>
<!--begin.rcode setup, eval=FALSE
end.rcode-->
</body>
</html>
|