Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data.table objects turn into data.frame after calling fix()

Every time I run the command fix(DT) on a data.table, after closing the fix window, DT turns into a data.frame object. Is this normal?

library(data.table)
DT <- data.table(a = 1:2, b = 2:3)

> class(DT)
[1] "data.table" "data.frame"

fix(DT) 

# close the window

> class(DT)
[1] "data.frame"

EDIT:

some session info:

R version 3.0.0 (2013-04-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
like image 432
Michele Avatar asked May 17 '13 13:05

Michele


1 Answers

fix invokes edit. However, there is not data.table method for edit (check using methods(edit)). Because a data.table is also a data.frame, edit.data.frame is used instead and it returns a data.frame as documented.

You could write your own edit.data.table, but I don't recommend it, since data.tables are often way too big to be edited that way in a sensible way.

like image 194
Roland Avatar answered Nov 15 '22 11:11

Roland