Hello together, i have a problem with an export. I want to export a data.frame, only if there ist data in it. My data.frame (CO.PHB) ist empty but with this code, the .txt-file gets exported every time, with no content.
{ pfad<-paste(paste(paste("C:/Test/","Reminder",sep=""), "Orders",sep="/"),"txt",sep=".") write.xls( Orders,pfad,colNames = TRUE,sheet = 1,from = 1,rowNames = FALSE ) if(dim(CO.PHB)[1]>0){ write.table( CO.PHB,pfad,row.names=FALSE,sep=" | ") }} how should my code look like, if i want only an Export, when there is data in the data.frame? Thanks Mat -- View this message in context: http://r.789695.n4.nabble.com/export-only-if-data-is-available-tp4657922.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.