R codes for modeling.