awalker89 / openxlsx

R package for .xlsx file reading and writing.
Other
365 stars 78 forks source link

Error in is.nan(tmp) : default method not implemented for type 'list' #528

Open KptnKermit opened 3 years ago

KptnKermit commented 3 years ago

Expected Behavior

Write Data into a Table

Actual Behavior

writeData and WriteDateTable stops with error Error in is.nan(tmp) : default method not implemented for type 'list'

Steps to Reproduce the Problem

(please attach an example xlsx file if possible)

Code:

Export File

dir.create("001_Export") setwd("./001_Export")

excel_overview_file <- createWorkbook() excel_overview_income <- addWorksheet(wb = excel_overview_file, sheetName = "Income") excel_overview_orig <- addWorksheet(wb = excel_overview_file, sheetName = "Cumulated costs") excel_overview_fixed <- addWorksheet(wb = excel_overview_file, sheetName = "Fixed costs") excel_overview_variable <- addWorksheet(wb = excel_overview_file, sheetName ="Variable costs") excel_overview_fixcats_monthly <- addWorksheet(wb = excel_overview_file, sheetName = "Fixcats_Monthly") excel_overview_varcats_monthly <- addWorksheet(wb = excel_overview_file, sheetName = "Varcats_Monthly") excel_overview_fixcats_yearly <- addWorksheet(wb = excel_overview_file, sheetName = "Fixcats_Yearly") excel_overview_varcats_yearly <- addWorksheet(wb = excel_overview_file, sheetName = "Varcats_Yearly") excel_overview_finanz <- addWorksheet(wb = excel_overview_file, sheetName = "Steuerausgleich")

excel_origin <- addWorksheet(wb = excel_file, sheetName = "Original data")

excel_overview_title <- ("001a_Finanzdaten_kumuliert.xlsx")

writeDataTable(wb = excel_overview_file, x = income, sheet = excel_overview_income, withFilter = TRUE, keepNA = FALSE, na.string = NULL)

writeData(wb = excel_overview_file, x = costs, sheet = excel_overview_orig)

writeData(wb = excel_overview_file, x = fixcosts, sheet = excel_overview_fixed)

writeData(wb = excel_overview_file, x = variablecosts, sheet = excel_overview_variable)

writeData(wb = excel_overview_file, x = fixcats_month, sheet = excel_overview_fixcats_monthly)

writeData(wb = excel_overview_file, x = varcats_month, sheet = excel_overview_varcats_monthly)

writeData(wb = excel_overview_file, x = fixcats_year, sheet = excel_overview_fixcats_yearly)

writeData(wb = excel_overview_file, x = varcats_month, sheet = excel_overview_varcats_yearly)

writeData(wb = excel_overview_file, x = finanz, sheet = excel_overview_finanz)

writeData(wb = excel_overview_file, x = yearly_data2, sheet = excel_overview_yearly)

writeData(wb = excel_overview_file, x = submat, sheet = excel_origin)

saveWorkbook(overwrite = TRUE, excel_overview_file, excel_overview_title)

Used Data.Frame: Attached as test.xlsx test.xlsx

1.

2.

3.

sessionInfo()

ycphs commented 3 years ago

Could you please create this also at ycphs/openxlsx?

I am maintaining the active fork of the package.

KptnKermit commented 3 years ago

Done.

Best regards

Werner

Dr. Werner Pessenhofer, @.*** M +43 650 66 27 617

On Mar 28, 2021, at 12:46 AM, Philipp Schauberger @.***> wrote:

Could you please create this also at ycphs/openxlsx ?

I am maintaining the active fork of the package.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or unsubscribe .