Reputation: 183
I imported a 150K row 40 col csv file into R. When I do:
typeof(mydata)
I get:
[1] "list"
However,
is.data.frame(mydata)
returns
TRUE
After spending a lot of time trying to convert mydata to a dataframe (after getting the first result) rather than a list, was I wasting my time?
Why the different results?
Upvotes: 0
Views: 432
Reputation: 18440
You were not wasting your time, since you learned something ;-)
Use class
instead of typeof
:
class(mydata)
The reason of the result reported by typeof
may be that, under the hood, a data.frame
is basically a list of columns.
Upvotes: 3