I know that a similar question exists but it doesn't solve my problem. I have a dataset which has two classes:
class(wind)
"data.frame" "data.table"
How can I use wind as data.frame or data.table or how can I extract just one class?
I tried class(wind)[1] to get the class data.table but that didn't work (I don't get anything printed). Is there another way?
You can use
class(wind) <- class(wind)[1]
But i don't recommend doing that because you will lose the class search mechanism in R, means some function which registered for the dropped class will not dispatched.