Update mining.r