Skip to content
Prev 280911 / 398503 Next

Summary tables of large datasets including character and numerical variables

On 11-12-26 5:44 AM, sparandekar wrote:
Using the tables package, you can get something like that as follows, 
assuming that "df" is your dataframe:

nonmissing <- function(x) sum(!is.na(x))

tabular(All(df, character=TRUE) ~ (typeof + length + nonmissing + min + 
max + mean + sd))

It isn't perfect:  it will skip anything that isn't numeric or character 
(e.g. factors).  There are ways to work around that, but they aren't as 
simple as you might like.  You can also use

sapply(df, class)

to see the classes of all the columns.

Duncan Murdoch