Masters student struggling with code can anyone help

At the minimum you should declare the library's you use... ( for maximal help provide a reprex)
FAQ: How to do a minimal reproducible example ( reprex ) for beginners

according to your code rarefac is an object you attempted to make with some function called iNEXT.
It will not be found if that iNEXT function call had an error