xl.write | R Documentation |
Methods for writing data to Excel sheet
xl.write(r.obj, xl.rng, na = "", ...)
## S3 method for class 'current.graphics'
xl.write(r.obj, xl.rng, na = "", delete.file = FALSE, ...)
## S3 method for class 'list'
xl.write(r.obj, xl.rng, na = "", ...)
## S3 method for class 'matrix'
xl.write(r.obj, xl.rng, na = "", row.names = TRUE, col.names = TRUE, ...)
## S3 method for class 'data.frame'
xl.write(r.obj, xl.rng, na = "", row.names = TRUE, col.names = TRUE, ...)
## Default S3 method:
xl.write(r.obj, xl.rng, na = "", row.names = TRUE, ...)
r.obj |
R object |
xl.rng |
An object of class |
na |
character. NA representation in Excel. By default it is empty string |
... |
arguments for further processing |
delete.file |
a logical value indicating whether delete file with graphics after insertion in Excel |
row.names |
a logical value indicating whether the row names/vector names of r.obj should to be written along with r.obj |
col.names |
a logical value indicating whether the column names of r.obj should to be written along with r.obj |
xl.rng
should be COM-reference to Excel range, not string. Method
invisibly returns number of columns and rows occupied by r.obj
on
Excel sheet. It's useful for multiple objects writing to prevent their
overlapping. It is more convenient to use xl
object. xl.write
aimed mostly for programming purposes, not for interactive usage.
c(rows,columns) Invisibly returns rows and columns number ocuppied by
r.obj
on Excel sheet.
xl
,
xlr
, xlc
, xlrc
,
current.graphics
## Not run:
xls = xl.get.excel()
xl.workbook.add()
rng = xls[["Activesheet"]]$Cells(1,1)
nxt = xl.write(iris,rng,row.names = TRUE,col.names = TRUE)
rng = rng$Offset(nxt[1] + 1,0)
nxt = xl.write(cars,rng,row.names = TRUE,col.names = TRUE)
rng = rng$Offset(nxt[1] + 1,0)
nxt = xl.write(as.data.frame(Titanic),rng,row.names = TRUE,col.names = TRUE)
data(iris)
data(cars)
data(Titanic)
xl.sheet.add()
rng = xls[["Activesheet"]]$Cells(1,1)
data.sets = list("Iris dataset",iris,
"Cars dataset",cars,
"Titanic dataset",as.data.frame(Titanic))
xl.write(data.sets,rng,row.names = TRUE,col.names = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.