O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The summary function

The summary() function is a convenient way to get a snapshot of the distribution of the variables. For numeric variables, it will give you the six important distribution statistics (mean, min, max, first, fifth, and third quartiles). The function will return a lot of information quickly. For a large number of variables, the output of the summary() function can be overwhelming (and not pretty!).

To limit the output, we will use the column numbers obtained previously and run a summary() function that exclude columns 12, 13, 16, 19, 20, and 21:

summary(df[,-c(12,13,16,19,20,21)],maxsum=7)

Or, if you would rather not use the index numbers and prefer using variable names, you can get the same results with the following code, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required