R: use data.frames to save metrics