Raw vectors can be an attractive type for certain low-cardinality variables because of its low memory footprint. However, using raw vectors in data.table are not fully supported. For example:
DT <- data.table(x = c(1, 2), y = raw(2))
setkey(DT, x) # ok
setkey(DT, y) # not supported
DT <- data.table(x = c(1, 2, 1), y = raw(3))
setkey(DT, x) # error Item 2 of list is type 'raw' which isn't yet supported (SIZEOF=1)
Is there a reason raw vectors can't be used?
Raw vectors can be an attractive type for certain low-cardinality variables because of its low memory footprint. However, using raw vectors in
data.tableare not fully supported. For example:Is there a reason raw vectors can't be used?