HTMLplot: Insert a graphic into an HTML output

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Exports the active graphic to a JPEG or GIF file and add it to a target HTML output, by writing the <IMG> tag.

Usage

1
2
3
4
5
HTMLplot(Caption = "", file = get(".HTML.file"), append = TRUE,
  GraphDirectory = ".", GraphFileName = "", GraphSaveAs = "png",
  GraphBorder = 1,  Align = "center", Width = 500, Height = 500,
  WidthHTML = NULL, HeightHTML = NULL, GraphPointSize = 12,
  GraphBackGround = "white", GraphRes = 72, plotFunction = NULL, ...)

Arguments

Caption

text to be placed below the graphic, as a caption

file

the target HTML file

append

logical. If 'TRUE' output will be appended to 'file'; otherwise, it will overwrite the contents of 'file'

GraphDirectory

path where file should be stored

GraphFileName

name of the file to produce (could be missing)

GraphSaveAs

an existing exportation device, such as jpg or gif

GraphBorder

HTML border option for the <IMG> tag

Align

HTML align option for the <IMG> tag

Width

width of the image to create (passed to the driver)

Height

height of the image to create (passed to the driver) (NULL: not specified)

WidthHTML

Width of the image in HTML

HeightHTML

Height of the image in HTML (NULL for not specified)

GraphPointSize

To be passed to the device creator function

GraphBackGround

To be passed to the device creator function

GraphRes

To be passed to the device creator function

plotFunction

Function to be evaluated for the on-the-fly creation of the graph to be exported

...

...

Details

Note that this function is coded to work automatically when using automatic exportation with HTMLStart. When using manualy, user should pay attention to the GraphDirectory option, so that graph files are in the same directory as HTML output files. When using to write reports in a non interactive way, first generate the graphic using a device and then use HTMLInsertGraph.

Value

no value returned.

Note

For a discussion about .HTML.outdir and HTLMenv, refer to HTMLStart

Author(s)

Eric Lecoutre

See Also

HTMLStart, HTMLInsertGraph

Examples

1
2
3
4
5
6
## Plots a graphic and insert it into the file /test.html.
## Target file and also graph directory should be changed when submitting this code...

myfile <- paste(tempfile(),".html",sep="")
plot(sin, -pi, 2*pi,main="Sinus")
# HTMLplot(file=myfile,GraphDirectory="/",Caption="Look at this curve!")

R2HTML documentation built on May 2, 2019, 5:11 p.m.

Related to HTMLplot in R2HTML...