improve code of pollutantmean.R and corr.R