added R scripts for ch 7 & 8