Create m_average.R