knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
The Chat in Source addin can be accessed from the RStudio Addins menu. The addin allows you to send selected code to the OpenAI API and insert the response into your .Rmd file.
Usage:
Optional:
To set a keyboard shortcut for the "Chat in Source" addin, follow these steps:
The Chat in Source
addin will modify your files directly. You can access it from the RStudio Addins menu. To use the addin, you first need to select the code you want to modify. Then, you can call the addin. The addin will send the selected code to the OpenAI API and insert the response in your file.
For convenience, you may want to map the addin to a keyboard shortcut. You can do this by going to Tools > Modify Keyboard Shortcuts and searching for "Chat in Source". You can then assign a custom keyboard shortcut to the addin.
The Chat in Source
addin allows you to customize the model and API service used by the app. Like the Chat
addin, the default service is OpenAI. To change this, you need to change the settings in the Chat
app. This will change the model for both the Chat
and Chat in Source
addins.
{width=700px}
The "Chat in Source" addin can augment your R workflow in many creative ways. Below are some practical examples:
Documentation Assistance
Code Improvement
Code Generation
Education and Learning
Collaboration
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.