writeExcel | R Documentation |
OUTPUTS
to an Excel file
While writing the OUTPUTS
to an Excel file, column oFileName
is embedded with
URL file.path(df1[,"oPath"],df1[,"oFileName"])
.
writeExcel(fileName, ...)
fileName |
(character) The name of the Excel file with extension 'xlsx'. Can contain relative or absolute file paths. |
... |
parameters passed to |
It is not a general function to save a data.frame or matrix to an Excel file. And there is no append
mode; the target file will be covered if already present.
none
write.xlsx
library(wfr)
library(openxlsx)
library(ggplot2)
df1=data.frame(A=c("a","a","b3"),
B=c("b1","b2","b3"),
C1=1:3,C2=2:4)
colWidth = "2,1,1,1"
header = "A | A | C | C || A | A | C1 | C2"
footer = "A|Arkansas$~ref$|1|header
|| C1|Kansas$^ref$|x|header
|| a|Arizona|2|body"
tmpDir = tempdir()
ofn = file.path(tmpDir, "tab.1.csv")
saveOutput(df1,ofn,caption = "1st testing table",header = header,
footer = footer,colWidth = colWidth,fontSize = 12 )
saveOutput(qplot(1:10,1:10),oPath=tmpDir,caption = "1st testing fig")
fn1=file.path(tmpDir, "output.xlsx")
writeExcel(fn1)
df2=read.xlsx(fn1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.