openai ChatGPT generated R code is considerably erroneous. But you can use it as a rough guide. You can also ask for alternative methods and implementations. Great tool to speed up the process of bringing ideas to life.