In statistics, standardization plays a crucial role as we have various attributes for modeling and all of them have different scales. So for comparison purposes, we need to standardize the variables to bring them on the same scale. Centering the values and creating the z scores is done in R by the scale() function. It takes the following arguments:
x: A numeric object
center: If TRUE, the object's column means are subtracted from the values in those columns (ignoring NAs); if FALSE, centering is not performed
scale: If TRUE, the centered column values are pided by the column's standard deviation (when center is also TRUE; otherwise, the root mean square is used); if FALSE, scaling is not performed
If we want to center the data of Volume in our dataset, we just need to execute the following code: