path <- "C:/temp/" pg <- htmlPageBegin(path,"htmlMaker.html",title="hmtlMaker", body.options="BGCOLOR=99CCFF",plot.method="png", comment="Intro to htmlMaker") htmlLine(pg, "
") htmlLine( pg, "

htmlMaker R (and S-Plus) code to generate webpages with plots

" ) htmlLine(pg, "This is an R package to generate html code for webpages, especially for batch") htmlLine(pg, "jobs where R is run in background mode. This is a basic program to") htmlLine(pg, "get simple webpages with graphs, including simple clickable graphs,") htmlLine(pg, "it is not a web design tool. You will need to know some html to") htmlLine(pg, "do anything beyond the simplest webpages. These webpages are") htmlLine(pg, "static html, no java or javascript is used.") htmlLine(pg, "

To work under R in interactive mode, R in batch mode, and S-Plus, the package now ") htmlLine(pg, "requires an argument to tell which method to use to produce plots.") htmlLine(pg, "The sample routines below assume you are running R in interactive mode.

") htmlLine(pg, "WARNING: Netscape Navigator (6.2 and 7.0) does NOT work correctly with clickable images: ") htmlLine(pg, "(1) it does not process multiple images with maps correctly,") htmlLine(pg, "(2) it does not display the alt=... text, except on the first graph on") htmlLine(pg, "a webpage, and (3) it does not follow the href= link.") htmlLine(pg, "Internet Explorer (5.5 and 6.0) does work correctly.

" ) htmlLine( pg, "There is terse documentation included in the source file" ) htmlLine( pg, "htmlMaker.R below. Also, see the source files ") htmlLine( pg, "and pages of output generated below.") # sample data for barplot htmlLine( pg, "

" ) ht <- runif(6)+.2 group.names <- c("brown","red","green","blue","cyan","pink") links <- paste( "#clicked.",group.names, sep="") htmlBarPlot(pg, ht, plot.file="sample_barplot.png", hyperlink=links, group.names=group.names, main="Sample barplot - click on a bar", color=1:6 ) htmlLine( pg, "

" ) htmlLine( pg, "

" ) htmlLine( pg, "


") for (i in 1:length(group.names)) { htmlLine( pg, paste("

You clicked on the ",group.names[i]," bar.

",sep="") ) } htmlLine( pg, "

You can have links go to different places, including different webpages

") htmlLine( pg, "


") # example of a table with links htmlLine( pg, "

" ) htmlTableBegin( pg, caption="

Download source or view examples

" ) htmlTableRow( pg,c("Description","File"), header=T ) htmlTableRow( pg, c("R code for htmlMaker", "htmlMaker.R" ) ) htmlTableRow( pg, c("R code to generate the four sample pages below", "htmlMakerTest.R" ) ) htmlTableRow( pg, c("Simplest plots","page1.html" )) htmlTableRow( pg, c("Clickable plots","page2.html" )) htmlTableRow( pg, c("plot options - color, tables","page3.html" )) htmlTableRow( pg, c("General plots (3-D, multipanel, etc.)","page4.html" )) htmlTableRow( pg, c("R code to generate this page", "htmlMakerWebpage.R" ) ) htmlTableEnd( pg) htmlLine( pg, "

" ) htmlLine( pg, "John Nolan's homepage" ) htmlLine( pg, "

Please send me e-mail if you find this package useful: jpnolan@american.edu

") # specific code to set up a webcounter, do not copy this code htmlLine( pg, " ") htmlLine( pg, " ") htmlLine( pg, '') htmlLine( pg, '') htmlLine( pg, '') htmlLine( pg, '') htmlLine( pg, '') htmlLine( pg, '') htmlLine( pg, '') htmlLine( pg, " ") htmlLine( pg, " ") htmlPageEnd(pg)