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 colnames function

Running the colnames() function is a convenient way of obtaining the index numbers for each of the variables. Using index numbers in R functions is a convenient and fast way of referencing variables.

However, changes in file format can change the order, so using this method is only recommended for interactive use:

To simplify the example, we will eliminate variables 12, 13, 16, 19, 20, and 21 from the analysis

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