0

When I run is.data.table(data.table) == TRUE the answer displayed back is false how do I make this true. I have tried to run the code but it doesn't work

Insea
  • 11
  • 2
  • Can you make a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) please – Conor Neilson Mar 25 '20 at 05:02

1 Answers1

0

The is.data.table returns a logical vector. It doesn't need to further do a comparison

library(data.table)
is.data.table(as.data.table(mtcars))
#[1] TRUE

If it is not a data.table, convert to data.table with setDT

setDT(dt1)
akrun
  • 874,273
  • 37
  • 540
  • 662
  • I thought having changing this fact would solve my problem but it hasn't I am still getting this message Error in `:=`(aao, (Y > 649)) : Check that is.data.table(DT) == TRUE. Otherwise, := and `:=`(...) are defined for use in j, once only and in particular ways. See help(":="). – Insea Mar 24 '20 at 23:33
  • @Insea can you convert to data.table first i.e. `setDT(yourdata)` and then apply the code – akrun Mar 24 '20 at 23:35
  • Not sure where that is – Insea Mar 24 '20 at 23:43