can we map dataframe to datatable

I would like to know if it is possible to establish a mapping relationship between dataframe and datatable.

It can convert user`s operations on a dataframe into ones on that datatable without modifying the original code.

This may solve the slow running problem of some R packages without having to modify the source code.

best wishes