Script AI

 

Menu location: AI assistance on the toolbar of the R script window.

 

AI assistance opens the Script AI pane beside the script window. Ask it about the script, about what R printed, or about the methods and how to go on, and it answers in the conversation and suggests R code. The answers come from ChatGPT through your own ChatGPT account: what you ask and what you choose to share go to OpenAI under your agreement with them, and your plan's allowance for Codex applies. StatsDirect has no account of its own and sends nothing until you press Send. The assistant cannot run R or change your documents; it proposes code for you to run.

 

The first time, Use my ChatGPT sets the connection up. StatsDirect downloads OpenAI's own component, about 123 MB, from OpenAI's release on GitHub, checks that it is the file expected, and installs it for your Windows account; then the sign-in page opens in your browser. Your work stays open throughout, and a question you had typed is kept. No API key is needed. You stay signed in from one session to the next until you sign out, through the button at the top of the pane, which also says how you are connected. Your existing ChatGPT chats are not brought in.

 

Each Send sends your question and the recent conversation. Nothing from your documents goes with it unless you say so under Sharing for this question: the script and what R printed, and the workbook you choose from those open, each only after you confirm that the content holds no person identifiers. Remove names, dates of birth, patient identifiers and free text that identifies a person before you share. With a document shared, the assistant can read the script and its output, read rows of the workbook as it needs them, a few thousand cells at a time, and read StatsDirect's own help on the methods. What has been shared stays in that conversation, and the ticks stay for the conversation, but every question with sharing needs the confirmation again.

 

The reply appears in the conversation as it is written, with headings, lists and tables, and R code in blocks with Copy and Open in R. Open in R on a block, or Open R code under the conversation for the last reply, opens a new script window holding the code with what it needs before it: the script as it was shared, the worksheet values the assistant read, and the code of earlier replies, each part labelled. Nothing runs until you press Run, and the status line asks you to review suggested code first. Copy R code copies the last reply's code for pasting elsewhere. Stop ends a reply. The conversation follows a reply while you are reading its end, and stays where you are if you have scrolled up or selected text.

 

The pane docks at the right of the window. Pop out makes it a window of its own and Dock brings it back; Close hides it, keeping the conversation and any question not yet sent. Each script has its own conversation, kept while the script is open and gone when it closes; New conversation starts afresh, and what was shared before is not carried into it. If the connection drops, the status line says why and Send connects again.

 

An organisation can switch the assistant off for its users with the policy value DisableOnlineTutor, a DWORD other than zero under Software\Policies\StatsDirect in HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER; the pane then says AI disabled by policy.

 

Help > Learning opens the lesson library, where the same tutor teaches statistics with StatsDirect and R, and Learning Options sets its preferences.