Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature request: Allow recycling of col_type #114
I tried to set a single value for col_type to text for an Excel sheet with multiple columns. I got this error message:
Error: Need one name and type for each column
Since there is no way to extract the number of columns before reading the file it would be great if col_type could recycle its arguments when the list is shorter than the number of columns, as read.table, read_table, and fread all do.
@rickdonnelly There is actually a way to extract the number of columns in an Excel sheet before reading it in. While I agree that it would be nice to have a recycling feature, this is the workaround I've been using:
You can obviously replace "text" in the
Hope this helps!
readxl/R/RcppExports.R contains a number of helper functions that are not exported. Some of these could be useful for reading in excel sheets with unknown characteristics ahead of time (e.g. for linux users with no access to excel):