Skip to content

posit-dev/posit-conf-2025-positron-assistant-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Positron Assistant demo

Welcome to the Positron Assistant demo for posit::conf 2025 in Atlanta!

With the help of Positron Assistant, this demo will guide you through exploring two datasets:

  • the Georgia Aquarium Species dataset using Python

  • the Atlanta Falcons football team datasets using R

Setup

If you're running this demo in a guided workshop, your interpreters and packages should already be set up for you in the demo environment. Please jump ahead to either the Python demo or R demo section and follow the steps!

Otherwise, click to expand the pre-requisites section below and follow the steps to set up your environment.

Pre-requisites if you're running this demo on your own machine

Pre-requisites

  1. Install and open Positron. We recommend the latest stable Positron version 2025.09.0-139.

  2. Copy this repository's GitHub URL to your clipboard: https://github.com/posit-dev/posit-conf-2025-positron-assistant-demo.git

  3. Clone this repository and open the folder in Positron

    1. Run the command "Workspaces: New Folder from Git..." in the Command Palette

    2. Paste in the repository URL you copied

    3. Select a local directory to clone the repository into

    4. Click OK

  4. Use the Positron Assistant guide to set up Positron Assistant with an Anthropic API key.

Python demo pre-requisites

  1. Ensure you have a Python interpreter (3.9 through 3.13) installed on your machine

  2. Create a virtual environment for this project

    1. Run the command "Python: Create Environment..." in the Command Palette

    2. Select Venv as the environment type

    3. Pick a base interpreter (we recommend the latest version of Python)

    4. Select the requirements.txt file in the dropdown to install the required packages

    5. Click OK

    6. Wait for the environment to be created and packages to be installed

  3. You're all set! Jump to the Python demo section and follow the steps!

R demo pre-requisites

  1. Ensure you have R (R 4.2 and higher) installed on your machine.

  2. Install the required packages by running the following commands in the R Console:

    install.packages("tidyverse")
  3. You're all set! Jump to the R demo section and follow the steps!

🐍 Python demo

Step 1: Run the script in the Console

  1. Open up the Python script python-demo.py in an editor

  2. Run the script by clicking the Play button in the Editor Actions bar

    • Once all the code has been run, you should see:

      • code executed in the Console

      • data loaded into the Variables pane

      • a plot rendered in the Plots pane

Step 2: View the data in the Data Explorer

Follow these steps to view data tables in the Data Explorer:

  1. Run the command "Session: Focus on Variables View", which will open up the Variables View if it is not already open.

  2. In the Variables View, double-click on the species variable or click the "View Data Table" icon to open the table in the Data Explorer.

  3. Play around with the Data Explorer to filter, sort, and visualize the data. For more information, see the Data Explorer documentation.

    • Open the "Summary Panel", which columns are missing data?

    • Use the "Summary Panel" to see the distribution of conservation_status. What is the most common status?

    • Sort the data by conservation_status and scientific_name by right clicking on the column name and clicking "Sort Ascending" or "Sort Descending".

Step 3: Explore the data with Positron Assistant

  1. Open the Positron Assistant pane by clicking on the Positron Assistant robot icon in the sidebar, or by opening the Command Palette (Cmd/Ctrl + Shift + P) and running the command "View: Show Chat".

  2. In the Positron Assistant pane, ensure your chat is in Ask mode. You can switch modes by clicking on the mode selector at the bottom of the chat pane. Positron Assistant offers three modes: Ask for questions and help (default), Edit for collaborative code modifications, and Agent for autonomous task execution including file management and code execution.

  3. We recommend selecting the Claude 4 Sonnet model for this activity. You can change the model by clicking on the model name at the bottom of the chat pane.

  4. Use the example messages below to explore the Georgia Aquarium Species dataset.

Example prompts

Try out these example prompts in Ask mode!

Please summarize the `species` data table
What do you see in the current plot?
Explain the values of the `conservation_status` column. Is there a hierarchy?
Based on data tables in my session, please suggest some starter code for interesting analyses or visualizations
  • Try out the code snippets Positron Assistant suggests by clicking the Play button on the code blocks.

  • If you run into issues, it's a good time to switch over to Agent mode (see optional next step) to let Positron Assistant help you debug!

You're done! πŸŽ‰

Step 4: [OPTIONAL] Explore more with Agent mode

Additional prompts for `Agent` mode

Agent mode allows Positron Assistant to modify and run code in the Console, making it possible to perform more complex tasks.

Additional prompts for Agent mode

  1. Start a new chat by clicking on the "+" icon at the top of the Positron Assistant sidebar chat.

  2. Switch to Agent mode by clicking on the mode selector at the bottom of the chat pane and selecting Agent.

  3. Ensure you have python-demo.py attached to the chat context. If it is not already attached:

    1. Open the file in the editor

    2. Drag the file tab to the sidebar chat; or in the Command Palette (Cmd/Ctrl + Shift + P), run the command "Chat: Add File to Chat".

  4. Then, try these additional prompts:

    Update the script to change the colour scheme to oceanic colours.
    
    • Run the script to see the changes reflected in the plot. If you're satisfied with the changes, you can "Keep" the changes.
    Create a heatmap of the conservation risk by region.
    
    • Positron Assistant may prompt you to "Run Code" to better understand the data and execute code in the Console. Click "Run Code" to execute the code in the Console.

πŸ“Š R demo

Step 1: Run the script in the Console

  1. Open up the R script r-demo.R in an editor

  2. Run the script by clicking the Play button in the Editor Actions bar

    • Once all the code has been run, you should see:

      • code executed in the Console

      • data loaded into the Environment pane

      • a plot rendered in the Plots pane

Step 2: View the data in the Data Explorer

Follow these steps to view data tables in the Data Explorer:

  1. Run the command "Session: Focus on Variables View", which will open up the Variables View if it is not already open.

  2. In the Variables View, click the "View Data Table" icon or double-click on any of the table variables to open them in the Data Explorer. Start with the falcons_seasons dataframe.

  3. Play around with the Data Explorer to filter, sort, and visualize the data. For more information, see the Data Explorer documentation.

    • Open the "Summary Panel", which columns are missing data?

    • Use the "Summary Panel" to see the distribution of Head Coach. Which Head Coach has the longest tenure?

    • Sort the data by W (wins) and PF (points for) by right clicking on the column name and clicking "Sort Ascending" or "Sort Descending".

Step 3: Explore the data with Positron Assistant

  1. Open the Positron Assistant pane by clicking on the Positron Assistant robot icon in the sidebar, or by opening the Command Palette (Cmd/Ctrl + Shift + P) and running the command "View: Show Chat".

  2. In the Positron Assistant pane, ensure your chat is in Ask mode. You can switch modes by clicking on the mode selector at the bottom of the chat pane. Positron Assistant offers three modes: Ask for questions and help (default), Edit for collaborative code modifications, and Agent for autonomous task execution including file management and code execution.

  3. We recommend selecting the Claude 4 Sonnet model for this activity. You can change the model by clicking on the model name at the bottom of the chat pane.

  4. Use the example messages below to explore the Atlanta Falcons football team datasets.

Example prompts

Try out these example prompts in Ask mode!

Please summarize the `falcons_scores` data table
What do you see in the current plot?
Explain what each of the columns means for someone who does not watch football
Based on the data tables in my session, please suggest some interesting analyses or visualizations
  • Try out the code snippets Positron Assistant suggests by clicking the Play button on the code blocks.

  • If you run into issues, it's a good time to switch over to Agent mode (see optional next step) to let Positron Assistant help you debug!

You're done! πŸŽ‰

Step 4: [OPTIONAL] Explore more with Agent mode

Additional prompts for `Agent` mode

Agent mode allows Positron Assistant to modify and run code in the Console, making it possible to perform more complex tasks.

Additional prompts for Agent mode

  1. Start a new chat by clicking on the "+" icon at the top of the Positron Assistant sidebar chat.

  2. Switch to Agent mode by clicking on the mode selector at the bottom of the chat pane and selecting Agent.

  3. Ensure you have r-demo.R attached to the chat context. If it is not already attached:

    1. Open the file in the editor

    2. Drag the file tab to the sidebar chat; or in the Command Palette (Cmd/Ctrl + Shift + P), run the command "Chat: Add File to Chat".

  4. Then, try these additional prompts:

    Change the plot to use a different colour scheme.
    
    • Run the script to see the changes reflected in the plot. If you're satisfied with the changes, you can "Keep" the changes.
    Create a heatmap of the win-loss percentage by season.
    
    • Positron Assistant may prompt you to "Run Code" to better understand the data and execute code in the Console. Click "Run Code" to execute the code in the Console.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •