R/excel_export.R

Defines functions excel_export

Documented in excel_export

excel_export <-
function(x,file,table_names=as.character(1:length(x)),row.names=F,...) {
  
  if(class(x)=="data.frame"){xlsx::write.xlsx(x,file,sheetName=table_names[1],row.names=row.names,...)}
  if(class(x)=="list"){ for(i in 1:length(x)){ xlsx::write.xlsx(x[[i]],file,sheetName=table_names[i],append=(i!=1),row.names=row.names,...)}}
}

Try the ImportExport package in your browser

Any scripts or data that you put into this service are public.

ImportExport documentation built on May 29, 2017, 10:55 a.m.