You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am reading a bunch of files with several columns, in some files these columns are in the files and in some other they are not (but they always contain the same information). In total there are 74 column names but I have 13, 13, 35, 38, 38, 44, 44 and 52 columns in each file.
read_xlsx is having a hard time guessing what type is each column. I would like to provide a named col_type such that if the column name is found it applies that type of data. Now I need to explore each file and look what type of data has each column and in which position in order to specify the type.
Currently only the position of col_type sets the type of the column. This would mean silently remove the missing col_types if there aren't in the file being read.
As a mock example I would like to be able to do something like this:
col_type<- c("Fecha"="date", "count"="numeric", "position"="text")
# Files of two columns
read_xlsx(file1, col_type=col_type)
# Files of all three columns in different order than the first one
read_xlsx(file1, col_type=col_type)
Ideally the check of the type should be done before cleaning the names (I have some columns with duplicate column names).
The text was updated successfully, but these errors were encountered:
#198 is the current issue re: upgrading col type specification, specifically making readxl more like readr (or, perhaps today, also more like vroom). So, I'm closing this in favour of #198. You're welcome to add details to that thread or allow this link to implicitly do that.
I am reading a bunch of files with several columns, in some files these columns are in the files and in some other they are not (but they always contain the same information). In total there are 74 column names but I have 13, 13, 35, 38, 38, 44, 44 and 52 columns in each file.
read_xlsx is having a hard time guessing what type is each column. I would like to provide a named col_type such that if the column name is found it applies that type of data. Now I need to explore each file and look what type of data has each column and in which position in order to specify the type.
Currently only the position of
col_type
sets the type of the column. This would mean silently remove the missing col_types if there aren't in the file being read.As a mock example I would like to be able to do something like this:
Ideally the check of the type should be done before cleaning the names (I have some columns with duplicate column names).
The text was updated successfully, but these errors were encountered: