ropensci / writexl

Portable, light-weight data frame to xlsx exporter for R
https://docs.ropensci.org/writexl
Other
210 stars 17 forks source link

File with multiple sheets is not recognized as excel file #75

Closed llrs closed 6 months ago

llrs commented 6 months ago

Many thanks for the useful package. I've been using it for a while without any problems.

However, today I'm creating an excel file with multiple sheets but when I check the folder (via nautilus in Ubuntu 22.04) they are recognized as zip files.

xlsx files recognized as zip files

They can be read via writexl::read_xlsx or via "Open With Other Application" with libreoffice, so I don't think there is a problem with the file format. But just wondering if it will lead to some problems in other machines (Windows), and it could lead some user to think it is not an Excel file (which I want to avoid).

data <- structure(list(Variable = c("lh_meanTh_mm", "lh_surfaceArea_mm^2", 
"rh_meanTh_mm", "rh_surfaceArea_mm^2", "Left-Lateral-Ventricle", 
"Left-Inf-Lat-Vent", "Left-Cerebellum-White-Matter", "Left-Cerebellum-Cortex", 
"Left-Thalamus", "Left-Caudate"), Description = c("Left hemisphere mean thickness", 
"Left hemisphere surface area", "Right hemisphere mean thickness", 
"Right hemisphere surface area", NA, NA, NA, NA, NA, NA), unitat = c("mm", 
"mm^2", "mm", "mm^2", "mm^3", "mm^3", "mm^3", "mm^3", "mm^3", 
"mm^3")), row.names = c(NA, -10L), class = c("tbl_df", "tbl", 
"data.frame"))
path <- writexl::write_xlsx(list(m = data, m2 = data))

This example worked fine in the tmp folder but not in a folder in my user directory. I uploaded the file to an external tool and when I downloaded it didn't recognize it as an Excel file.

I don't know if this is some headers or some feature missing in the files it creates or it is an issue in how is my computer configured, but I thought it might be helpful for other users to know this "issue".

R: 4.4.0 writexl: '1.5.0'