It was my great pleasure to present last week to the NYC Data Hackers on the topic of Copilot for R. If you haven't come across Copilot before, it's like an AI-based pair programmer that suggests new lines of code, and perhaps entire functions, based on context. In the presentation (video below) I showed how while I was editing in Visual Studio Code with Copilot enabled, it suggested tidyverse functions for cleaning a data set, and even the code for performing an analysis of variance:
I also took a behind-the-scenes look to see how Copilot uses Generative AI to make its suggestions. With the Azure OpenAI Service, you can access the underlying OpenAI Codex model directly, and generate code suggestions via its API. I showed an R script to access the OpenAI API directly using the httr2 package, and also provided an R function to call an OpenAI model. We also had some fun with the text-based GPT3 model to generate a poem about Python and to suggest a funny cat name token by token.
Thanks to everyone who attended the talk and asked such awesome questions! If you missed it, the video is above and all the code, links and resources can be found in the GitHub repo linked below.
GitHub (revodavid): Copilot for R