File: HTMLInsertGraph.Rd

package info (click to toggle)
r-cran-r2html 2.3.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 976 kB
  • sloc: javascript: 832; xml: 56; makefile: 12; sh: 8
file content (53 lines) | stat: -rwxr-xr-x 1,813 bytes parent folder | download
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
\name{HTMLInsertGraph}
\alias{HTMLInsertGraph}

\title{ Insert a graph in a HTML report}
\description{
  Write the HTML <img> tag to an output, so that a existant graph could be displayed in the HTML report
}
\usage{
HTMLInsertGraph(GraphFileName="", Caption="", GraphBorder=1,
Align="center", WidthHTML=500, HeightHTML=NULL,
file=HTMLGetFile(), append=TRUE,...)
}

\arguments{
  \item{GraphFileName}{ Name of the target graph (GIF, JPEG or PNG) }
  \item{Caption}{ If non empty, text to be written under the graph, as its caption}
  \item{GraphBorder}{ Size of the border, in pixels }
  \item{Align}{ Alignment of the graph (center, left or right) }
  \item{WidthHTML}{ Width of the image in HTML}
  \item{HeightHTML}{ Height of the image in HTML (NULL for not specified)}
  \item{file}{ Name of the target HTML file (the report) }
  \item{append}{ logical. If 'TRUE' output will be appended to 'file'; otherwise, it will overwrite the contents of 'file'}
  \item{\dots}{ \dots }
}
\details{
  The steps to add a graph to a HTML file are the following: first create the graph, by using a device convenient for web pages, such as GIF, JPEG or PNG. Ensure to write it in the same directory than the HTML file. Then call HTMLInsertGraph.
  }
\value{
	no value returned.  
}

\author{ Eric Lecoutre }

\seealso{ \code{\link{HTMLplot}}  }
\examples{

	directory=tempdir()
	HTMLoutput=file.path(directory,"output.html")
	graph1="graph1.png"
	# Write graph to a file
	\dontrun{png(file.path(directory,graph1))}
	\dontrun{plot(table(rpois(100,5)), type = "h", col = "red",
	              lwd=10,main="rpois(100,lambda=5)")}
	\dontrun{dev.off()}
	# Insert graph to the HTML output
	HTMLInsertGraph(graph1,file=HTMLoutput,caption="Sample discrete distribution plot")
}

\keyword{ print }
\keyword{ IO }
\keyword{ file }