So I have this problem with R. I have a table and I need to find what is the class of the variable (i.e. I'm presuming that would be referring to the data in the columns).
The data is quite big i.e. many rows.
Whenever I write class(nameofthedata)
it doesn't work and whenever I write class("titleofthecolumn")
it gives me back "character i.e. referring to the title of the column which is not what I'm after...
I would suggest the following solution:
You can the convinetly identify classes of all variables in the data frame:
t()
used only for the code presentation.If you want to know the class of a specific column, say
schoolid
, just callclass()
on that column, like so:If you want to know the classes of all columns, you can apply
class()
to all columns usingsapply()
: