Search code examples
rwritexl

write_xlsx(all_trips, "trips.xlsx") Error: Error in libxlsxwriter: 'Worksheet row or column index out of range.'


Does anyone know how to fix this error?

Language: R

I want to export the file to xlsx to used at Tableau Public but encounter the error

write_xlsx(all_trips, "trips.xlsx")

Error: Error in libxlsxwriter: 'Worksheet row or column index out of range.'

Maybe the file too big?

str(all_trips) #See list of columns and data types (numeric, character, etc)
spec_tbl_df[,13] [3,574,524 x 13]

(S3:spec_tbl_df/tbl_df/tbl/data.frame)


Solution

  • The issue is the the dataframe has 3 millions rows and Excel only supports 1 million rows (or specifically 1,048,576 rows), see Excel's limits.