0
我有以下問題[R openxlsx Excel導出:XML錯誤
我來自R導出數據與新庫openxlsx
到Excel。該代碼看起來像這樣
mystyle = createStyle(fontName="Arial",fontSize=8,halign="right",wrapText=TRUE)
excel_export = function(wb,sheet,data,mystyle){
addWorksheet(wb,sheet,gridLines=FALSE)
#setRowHeights(wb,sheet,rows=1:nrow(data),heights=rep(0.13,nrow(data)))
addStyle(wb,sheet,mystyle,rows=1:nrow(data),cols=1:ncol(data),gridExpand=TRUE)
pageSetup(wb,sheet,orientation="landscape",scale=80,left=0.25,right=0.25,top=0.25,bottom=0.25)
writeDataTable(wb,sheet,data,xy=c(2,2),colNames=TRUE,rowNames=TRUE,tableStyle="TableStyleMedium9",withFilter=FALSE)
}
excel_export(wb,"Statics",dg,mystyle,0.8,20)
當我這樣做,我在Excel中收到以下錯誤信息:
<removedPart>removed part: /xl/tables/table3.xml-Part with XML-Error. (Sheet) A attribute must not contain '<' enthalten. Row 1,
Column 133.</removedPart>
(我翻譯此錯誤消息德語譯成英文)。
我使用Excel 2010,64位版本和R 3.1.1。語言設置爲德語。
即使沒有丟失數據,它也不起作用。如果我將數據發送到10個以上的工作表,則不能再打開xlsx。更少的情況下,我在數據傳輸中完成的所有格式都未反映在輸出文件中。此行爲可能是由於語言或國家/地區設置的原因嗎?或者還有其他想法嗎? – user2157086 2015-01-12 15:15:08