move require ggplot2 only if plot==TRUE is used