R codes for estimating water retention and infiltration model