Rewriting RCHIC in R