我有以下问题
我使用新库openxlsx将数据从R导出到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>(我将此错误消息从德语翻译成英语)。
我使用的是Excel2010,64位版本和R 3.1.1。语言设置为德语。
发布于 2014-10-06 22:01:35
我过去经常收到这个错误。我检查了R和Excel中的所有数据/结果,发现没有丢失数据。我在StackOverflow、谷歌和IRC上做了更多的调查,我得出的结论是这条消息可以忽略。
请检查您的源数据和目标数据。您应该能够确认没有丢失数据,如果是这样,那么您可以忽略XML错误。
https://stackoverflow.com/questions/26212851
复制相似问题