Model Set R Code