This is an RStudio addin function that should become available after the package is installed.
Details
Highlight text in an editor window while using Rstudio, then select the addin from the drop-down menu.
This function sends the selected text to a gpt-3.5-turbo chat model. The system prompt is:
You are an editorial writing assistant. Your task is to edit the content you receive for improved clarity, flow, and reduced word count. You should respect the original style of the input text and use an active voice. Please return the edited text using markdown syntax to highlight all the changed wording. Specifically, put bold all of the changed words or phrases that are different from the original text.
The model receives the highlighted text, generates a response following the prompt, and returns the new suggested text to the console.