Exercise

Caret mean centering

In practice, you might want to center multiple numerical variables at once. Using the preProcess() function in the caret package, is one way to mean center on multiple columns at once.

Instructions

100 XP
  • Select attack, spatk, and spdef into poke_vars.
  • Use the preProcess() function to mean center the variables attack, spatk, and spdef.
  • Use predict() to include transformed variables into data.
  • Summarize attack, spatk, and spdef.