Luminosity measurements for the R scan experiment at BESIII