Open philippechataignon opened 5 years ago
What a terrible default :man_facepalming:
hardly seems like a "repair"
fwiw, openxlsx
works well (and is more tinyverse-friendly).
library(data.table)
library(openxlsx)
DT <- setDT(openxlsx::read.xlsx("https://chataignon.com/files/read_xl.xlsx"))
DT
# id X2 X3 text Nom.très.long.à.la.Excel
# 1: 1001 1002001 0.9199906 sdf 45
# 2: 1002 1004004 0.1672665 dfsdfsdf 65
# 3: 1003 1006009 -0.7392416 sdffdsfsd 78
There is another example of ..colname
use in https://github.com/mlr-org/mlr3/blob/adc6768e9817364a969797eba9157c4f2844bc45/R/DataBackendDataTable.R#L141 which uses such name for own internal processing, probably not exposed to user
I sometimes use
readxl
package to read Excel file. Since last version (1.2.0) I noticed a problem related to the version 2.0 of the packagetibble
. Now, Excel columns with no header name are renamed..1
,..2
becausetibble
changes his algorithm for repairing variable names. See this article : .name_repair.I always use
data.table
for my data.frames and my program broke afterreadxl
upgrade with a data.table error. It seems there is a confusion with variables names..1
,..2
and the..
data.table syntax used as with=F replacement.Perhaps data.table can interpret
..1
as a variable name because it can't be a indirection. I never realize before but..var
is a valid variable name in R.#
Output of sessionInfo()