I am new for R Programming so what would i tried to add border for all cells by using xlsx my script is below
library(xlsx)
wb <- createWorkbook(type='xlsx')
sheet <- xlsx::createSheet(wb, sheetName = "addDataFrame1")
data <- data.frame(mon=month.abb[1:10], day=1:10, year=2000:2009,
date=seq(as.Date("1999-01-01"), by="1 year", length.out=10),
bool=c(TRUE, FALSE), log=log(1:10),
rnorm=10000*rnorm(10),
datetime=seq(as.POSIXct("2011-11-06 00:00:00", tz="GMT"), by="1 hour",
length.out=10))
cs1 <- CellStyle(wb) + Font(wb, isItalic=TRUE)+Fill(foregroundColor = "lightblue",backgroundColor = "lightblue", pattern = "SOLID_FOREGROUND")
cs2<-Border(color="black", position=c("BOTTOM", "LEFT","TOP","RIGHT"), pen=c("BORDER_THIN", "BORDER_THIN","BORDER_THIN","BORDER_THIN"))
addDataFrame(data,sheet,col.names = TRUE,row.names = FALSE,startRow = 2,startColumn = 1,colnamesStyle = cs1,
rownamesStyle = cs2)
xlsx::saveWorkbook(wb, file="E:/ff.xlsx")