Norms the data within specified groups in a data frame; it normalizes each subject (identified by idvar) so that they have the same mean, within each group specified by betweenvars.
normDataWithin(data = NULL, idvar, measurevar,
betweenvars = NULL, na.rm = FALSE, .drop = TRUE)
a data frame.
the name of a column that identifies each subject (or matched subjects)
the name of a column that contains the variable to be summariezed
a vector containing names of columns that are between-subjects variables
a boolean that indicates whether to ignore NA's
should combinations of variables that do not appear in the input data be preserved (FALSE) or dropped (TRUE, default)
a data frame with normalized data
http://www.cookbook-r.com/Graphs/Plotting_means_and_error_bars_(ggplot2)