Code with AI

Coding R with the help of artificial intelligence tools.

Introduction

Among the many capabilities of Artificial Intelligence (AI) for generating text content and images, ChatGPT and other text generators stand out for their ability to produce source code in various programming languages.

This is a brief introduction to using AI services for programming.

Download the slides here.

Requirements

For this session we will work with free services. The two AI-powered search engines YOU.com and perplexity may be fair enough for simple tasks. They also have the advantage that you don’t have to log in, and the answers are linked to source websites.

More complex tasks may be better handled by ChatGPT. This application also offers some free services, but you need to register with OpenAI to access the chatbot.

Another chatbot you could try is Google’s Gemini, which can be accessed through a Google account.

BLACKBOX AI is much more focused on programming, but can only be used with a commercial licence (a free trial is available).

Since we want to work with Shiny applications, we need to install the appropriate package.

install.packages("shiny")

Exercises

  • Create a calendar app
  • Create a poket calculator
  • Create a fictional data set