base R |
class(iris_tbl$sepal_length) |
Will return the class of the column titled ‘sepal_length’ |
base R |
sapply(iris_tbl, class) |
Will apply the class() function to all columns in the iris_tbl |
base R |
str(iris_tbl) |
Will return the internal structure of the iris_tbl, which includes the dimensions of the df/tibble, column names, column types and first few observation values |
purrr |
map_chr(iris_tbl, class) |
The tidyverse equivalent to sapply() |
dplyr |
glimpse(iris_tbl) |
glimpse() is like a transposed version of print(): columns run down the page, and data runs across. It’s a little like str() but shows you as much data as possible. |
skimr |
skim(iris_tbl) |
returns variable types, names, statistical summaries & histograms of numeric variables. |
DataExplorer |
plot_str(iris_tbl) |
while more useful for lists, returns a plot of the internal structure of your data. |