Since it wasn't stated clearly, I just add this:
I was looking for a way to create a table which holds the number of occurrences of all the data types.
Say we have a data.frame
with two numeric and one logical column
dta <- data.frame(a = c(1,2,3),
b = c(4,5,6),
c = c(TRUE, FALSE, TRUE))
You can summarize the number of columns of each data type with that
table(unlist(lapply(dta, class)))
# logical numeric
# 1 2
This comes extremely handy, if you have a lot of columns and want to get a quick overview.
To give credit: This solution was inspired by the answer of @Cybernetic.