I'm not familiar with the models you're interested in, but it's possible someone else around here is. However, we generally encourage users to post their own attempts at coding and ask questions of the community where you get stuck.
If you're new to R, then the DataCamp tutorials are probably a good place to get your feet wet before trying a more advanced model.