I'm developing a package that uses data.table, but when I call certain data.table functions, such as DT[, ..colnames]
or DT[grepl("foo", col)]
or DT[, .(colname)]
I get errors like:
"colnames not found" or "could not find function "."". These errors are being called from data.frame so I guess when R looks for the functions, it's looking for them inside data.frame instead of data.table. When I run class(DT)
, I get "data.table" "data.frame"
I also tried DT[, data.table::.(colname)]
but get the error that '.' is not an exported object from namespace:data.table.
I haven't run into this behavior outside of the context of package development. Can someone provide me with some advice?