Export to HTML tables {GCDkit} | R Documentation |
Outputs the specified data with (optional) labels into HTML. This format is useful for importing into spreadsheets, word processors or publishing on the WWW.
HTMLTableMain(what,digits=2,desc=NULL,title=" ",sum.up=FALSE,open=TRUE, close=TRUE,browse=TRUE,filename=paste(data.dir,"R2HTML/htmltable",sep="/"), rotate=FALSE) HTMLtableOrdered(what,which=rownames(what),labs=labels,digits=2,desc=NULL, title=" ",sum.up=FALSE,key1=NULL,key1descending=FALSE,key2=NULL, filename=paste(data.dir,"R2HTML/htmltable",sep="/"),split.by=25,rotate=TRUE) HTMLTableWR(filename="htmltable") HTMLTableResults(filename="htmltable")
what |
numeric matrix; data to be exported |
digits |
required precision |
desc |
name of the columns within 'labels' to be attached to the table |
title |
main title |
sum.up |
logical; should be a sum calculated? |
open |
logical; should be opened a new HTML file? |
close |
logical; should be the HTML file closed when finished? |
browse |
logical; should be the HTML file finally opened in the default browser? |
filename |
optional name for the file produced |
rotate |
logical, should be the table transposed, with samples in columns and variables in rows? |
which |
(optional) sample names in numeric matrix 'what' for the output |
labs |
name of variable with textual labels |
key1 |
is a variable in numeric matrix 'what' |
key1descending |
logical; should be the 'key1' sorted in a descending order? |
key2 |
is a grouping information (name of a column in 'labs' or a character vector) |
split.by |
maximal number of data columns per page |
HTMLTableWR
and HTMLTableResults
are GUI front ends to
HTMLTableMain
, the former enabling the user to choose
samples (rows) and columns for the output using the searching mechanisms common
in the GCDkit.
HTMLTableWR
outputs the numeric data (with optional labels and sum)
stored in the data matrix 'WR'
.
HTMLtableOrdered
also outputs the numeric data stored in the numeric matrix specified
by parameter 'what'
. Optional argument 'which'
gives the list of sample names (rows)
in the matrix to be saved. The data are first sorted based on 'key2'
, which typically gives
a grouping information (name of a column in 'labs'
). Within each of the groups, the data
are further sorted based on the numeric variable 'key1'
. See example.
HTMLTableResults
outputs the results of the most recent calculation
(with optional labels and sum) as stored in the variable 'results'
.
The plugin attempts to format sub- and superscripts in the names of variables.
The created file 'filename'
is placed in the subdirectory 'R2HTM'
of the current working directory; when finished, it is previewed in a browser.
The style for the table is determined by the cascade style file R2HTML.css
in the subdirectory 'Plugin'
.
None.
The plugin uses R2HTML library, which must be downloaded from CRAN and properly installed. Its presence is checked before the code is executed.
The R2HTML package was written by Eric Lecoutre.
Vojtěch Janoušek, vojtech.janousek@geology.cz
data(sazava) accessVar("sazava") HTMLTableMain(WR[,c("SiO2","MgO","FeOt")],digits=2,desc="Intrusion",title="Sazava [wt.%]") HTMLtableOrdered(WR[,LILE],digits=1,key1="SiO2",key2="Intrusion",title="Large Ion Lithophile Elements (ppm)",split.by=3)