This lesson is free.
Join Ally to see every lesson on using AI with R.
Transcript
Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.
Loading transcript...
I took one small R script that returns NA when averaging a fake client survey and tried to fix it in three places: Claude on the web, the Claude Code extension in Positron, and Claude Code in the terminal. The web chat could only guess at the cause, while the other two could look at my data and make the fix.
You'll learn:
- Why AI in a web chat can only guess at problems in your code, since it can't see your data or the rest of your project
- How to install the Claude Code extension in Positron, which works because Positron is a fork of VS Code
- How to install Claude Code from the terminal and start it by typing claude
- How to ask Claude Code to fix a specific problem, such as NA values or a misspelled column name, and have it edit your script directly
- A way to check an AI fix by running the code yourself afterward, as when the first suggested fix still returned NAs and a second issue turned up
Tools mentioned: Claude, Claude Code, Positron, VS Code, glimpse
Key moments:
- 00:00 Where to work with AI: three options
- 00:22 Demo setup: fake client survey returns NA
- 00:38 Pasting code into Claude on the web
- 01:16 Why the web chat is just guessing
- 01:45 Installing the Claude Code extension in Positron
- 02:15 Asking about the NAs in the editor
- 02:57 Pasted fix still returns NAs
- 03:14 Claude fixes the NA issues directly
- 03:43 Auto mode and other modes
- 04:41 Setting up Claude Code in the terminal
- 05:16 Running Claude Code and fixing the typo
- 06:10 Recap of the three approaches