It would be handy if there was some way to use OR statements within fread.
Some of the information I work with has both variable column positions and field names; but there is only ever one form of a field name present at any one time.
As far as I'm aware, this isn't available with stock data.frames but perhaps there's some way to add the functionality in data.tables. I think it would require a consistent name to assigned first within the function; e.g.
select = c('a | a1 | a2', 'b | b1 | b2'),
col.names = c('a | a1 | a2' = 'a', 'b | b1 | b2' = 'b'),
colClasses = c(a = 'class', b = 'class'),
To avoid collisions it would only need to warn if it encounters more than one OR variable within a file.
It would be handy if there was some way to use OR statements within fread.
Some of the information I work with has both variable column positions and field names; but there is only ever one form of a field name present at any one time.
As far as I'm aware, this isn't available with stock data.frames but perhaps there's some way to add the functionality in data.tables. I think it would require a consistent name to assigned first within the function; e.g.
select = c('a | a1 | a2', 'b | b1 | b2'),
col.names = c('a | a1 | a2' = 'a', 'b | b1 | b2' = 'b'),
colClasses = c(a = 'class', b = 'class'),
To avoid collisions it would only need to warn if it encounters more than one OR variable within a file.