col_type seems to mess with importation (excel file)

Hello, once again importation happened to be way harder than expected ...

I want to import this file from the French government :

The problem is that when I execute my trusty read_excel("donnees/2008/2008+3500.xls",sheet = "Tour 1")
function I get 50+ warnings saying :
In read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, ... :
Expecting logical in...
Which I think mean that R don't understand the class of theses columns. So I try to input the class in the col type argument but it changed nothing except that the warnings don't shows anymore but the data remains unchanged. I've got NA instead of the expected values.
I would love to reprex it but I don't understand the path to use when reprexing it since it use a miscellaneous directory.

Thanks for your help

I typically use openxlsx package for my excel reading needs. I like it as it has no java dependency and typically works well for me.
It failed on this file, which seems to be a classic 2003 style .xls file, and not a more modern xlsx.
I used excel itself to 'save as' xlsx, and thenback to R, openxlsx::read.xlsx succeeded to read the first sheet without issue.

Alright so I try doing the same but when using readr::read_excel the same issues occurs. When using openxlsx::read.xlsx, it is true that it doesn't return any warnings but when checking manually if it did the job it appear that the values are still missing. For example, read excel told me that for row 2129 column 117 I should have "DESHAYES" but when checking with annee2008_t1_p35001[2129,117] I have a missing value. Goes probably the same for the other warnings. It s really strange

Sorry the index doesn't match it's working I should have 4 values for the columns 117 and I have them thank you so much !!!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.