calculating z scores
The scale() function will center and/or scale a numeric object. Use center = TRUE to subtract the mean from the values; use scale = TRUE to divide the centered values by the standard deviation to produce z scores. center variable A scale(A, center = TRUE, scale = FALSE) generate z-scores for variable A scale(A, center = TRUE, scale = TRUE) Lets try it with EMG data