<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "https://jats.nlm.nih.gov/publishing/1.3/JATS-journalpublishing1-3.dtd"><article xml:lang="en" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ali="http://www.niso.org/schemas/ali/1.0/" article-type="research-article" dtd-version="1.3"><front><journal-meta><journal-id journal-id-type="issn">2607-9917</journal-id><journal-title-group><journal-title>Bulletin de la Dialyse à Domicile</journal-title><abbrev-journal-title>Bull Dial Domic</abbrev-journal-title></journal-title-group><issn pub-type="epub">2607-9917</issn><publisher><publisher-name>RDPLF</publisher-name><publisher-loc>France</publisher-loc></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.25796/bdd.v9i2.87112</article-id><article-categories><subj-group><subject>Artificial intelligence</subject></subj-group></article-categories><title-group><article-title>Four Best Practices for Using ChatGPT/Claude as an Effective R Assistant</article-title></title-group><contrib-group><contrib contrib-type="author"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0002-1956-6579</contrib-id><name><surname>Vedova</surname><given-names>Claire Della</given-names></name><address><country>France</country></address><xref ref-type="aff" rid="AFF-1"></xref></contrib></contrib-group><aff id="AFF-1">Freelance trainer – Manosque (France)</aff><author-notes><fn fn-type="coi-statement"><label>Conflict of Interest</label><p>The author works as a freelance consultant specialising in clinical methodology, biostatistics and R expertise. She also delivers professional training courses on statistics and the R software.</p></fn></author-notes><pub-date iso-8601-date="2026-6-15" publication-format="electronic" date-type="pub"><day>15</day><month>6</month><year>2026</year></pub-date><pub-date date-type="collection" iso-8601-date="2026-6-15" publication-format="electronic"><day>15</day><month>6</month><year>2026</year></pub-date><volume>9</volume><issue>2</issue><issue-title>Home Dialysis Bulletin (BDD)</issue-title><fpage>103</fpage><lpage>114</lpage><history><date date-type="received" iso-8601-date="2026-5-29"><day>29</day><month>5</month><year>2026</year></date></history><permissions><copyright-statement>Author retains copyright</copyright-statement><copyright-year>2026</copyright-year><copyright-holder>Claire Della Vedova</copyright-holder><license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/"><ali:license_ref xmlns:ali="http://www.niso.org/schemas/ali/1.0/">https://creativecommons.org/licenses/by/4.0/</ali:license_ref><license-p>This is an Open Access article distributed under the terms of the Creative Commons Attribution 4.0 International License (CC BY 4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p></license></permissions><self-uri xlink:href="https://bdd.rdplf.org/index.php/bdd/article/view/87112" xlink:title="Four Best Practices for Using ChatGPT/Claude as an Effective R Assistant">Four Best Practices for Using ChatGPT/Claude as an Effective R Assistant</self-uri><abstract><p>Artificial intelligence can be of considerable help to those wishing to publish their work; however, using it without a critical eye can lead to completely false results. We felt it would be useful to ask a biostatistician and trainer to raise our readers’ awareness of the potential pitfalls of such software when analysing their data, using the example of a programme widely used in medical research.This article presents four best practices for the effective use of language models (LLMs) such as ChatGPT or Claude in an R programming context. The author begins by describing the three most common errors produced by LLMs: the invention of non-existent functions, the use of obsolete syntax and, even more seriously, the suggestion of inappropriate statistical methods. These errors can go unnoticed by beginners and lead to erroneous analyses. It is therefore essential to systematically check the suggested functions, pay attention to R’s warning messages, and understand the conditions under which the recommended statistical tests apply.The article then details a three-step method for obtaining more reliable results: providing a precise context regarding the data and the working environment, clearly describing the desired objective, and specifying the expected format of the output. The author places particular emphasis on data confidentiality.A third section explains how to verify that generated code actually works. Four checks are suggested: checking for the absence of errors and “warnings”, verifying the structure of the results, assessing the plausibility of the values obtained, and testing the code on a small set of known data.Finally, the article specifies when to prioritise an LLM, when to consult the official R documentation, and when to seek the advice of a competent human. The overall aim is to empower the user whilst using LLMs as support tools rather than as substitutes for critical thinking.</p></abstract><kwd-group><kwd>Large language model</kwd><kwd>R-sofware</kwd><kwd>statistics</kwd><kwd>ethics</kwd><kwd>nephrology</kwd><kwd>dialysis</kwd></kwd-group><custom-meta-group><custom-meta><meta-name>File created by JATS Editor</meta-name><meta-value><ext-link ext-link-type="uri" xlink:href="https://jatseditor.com" xlink:title="JATS Editor">JATS Editor</ext-link></meta-value></custom-meta><custom-meta><meta-name>issue-created-year</meta-name><meta-value>2026</meta-value></custom-meta></custom-meta-group></article-meta></front><body><p>Editor’s note</p><p>Claire Della Vedova is a biostatistics engineer and data analyst. She uses the R software daily to analyze data. She has worked for over 15 years in the fields of the environment and health, and has trained numerous students and researchers in the use of R. Since November 2017, she has been running the blog “Statistics and R Software,” which aims to help beginners better understand classical statistical methods and use R more effectively, particularly through tutorials: https://delladata.fr/blog. A few years ago, she wrote several introductory articles on this software in the BDD [1-6]. R is available for free download at https://www.r-project.org.</p><p>-------------------------------------------------------------------------------------</p><p>I’m being asked this question more and more often: “Now that ChatGPT writes R code, is it still worth learning R?”</p><p>My answer is yes! More than ever!</p><p>AI amplifies a skill; it doesn’t create it. Without a foundation, it’s impossible to verify what AI produces, correct an error, or adapt its code to your data. So, to use ChatGPT or Claude effectively with R, you must first master the fundamentals. To lay this foundation, I created my very first video course, accessible and designed for those who are self-taught: Getting Started With R and RStudio—The Essentials in 2 Hours and 15 Minutes (see Appendix I).</p><sec><title>1. LLMs’ Three Typical Errors in R</title><p>LLMs (ChatGPT, Claude, Copilot…) are trained on millions of lines of R code, but still regularly produce errors that a beginner might not notice. Here are the three main types to be aware of.</p><sec><title>1.1 Error #1: The function that doesn’t exist</title><p>The LLM invents a function that seems plausible but doesn’t exist, or it assigns a function to the wrong package.</p><p>Question asked to ChatGPT:</p><p>“How do I calculate a standardized Z-score on my age column?”</p><p>Response provided:</p><p>library(tidyverse)</p><p>mydata &lt;- mydata %&gt;%</p><p>mutate(z_age = standardize(age))</p><p>The problem:</p><p>The standardize() function does not exist in the tidyverse.</p><p>You must either use scale(age) (base R) or (age - mean(age)) / sd(age).</p><p>How can you spot this?</p><p>The code throws an error: “could not find function ‘standardize’“:</p><p>Error in `mutate()`:</p><p>ℹ In argument: `z_age = standardize(age)`.</p><p>Caused by error in `standardize()`:</p><p>! could not find function «standardize»</p><p>If you type a function name in the RStudio console preceded by a “?” (for example: ?standardize), and the documentation finds nothing, it’s most likely a hallucination!</p></sec><sec><title>1.2 Error #2: Obsolete syntax</title><p>The LLM suggests syntax that worked 2 or 3 years ago but is now deprecated or has been replaced.</p><p>Typical examples:</p><p>• Suggesting `summarize_each(funs(mean))` instead of `summarize(across(everything(), mean))` (the first form has been obsolete since dplyr 1.0)</p><p>• Using `aggregate(data, by=list(group), FUN=mean)` is much more readable and efficient than `group_by() %&gt;% summarize()`</p><p>• Mixing packages that are no longer maintained (e.g., plyr when dplyr has been the standard for a long time)</p><p>How can you spot this?</p><p>The code works, but RStudio displays a warning message such as “summarize_each() was deprecated in dplyr 1.0.0.”</p><p>Pay attention to the warnings returned by R and displayed in the console—that’s what they’re there for!</p><p>Rule of thumb:</p><p>If a deprecation warning appears, ask the LLM, “Give me the current, non-deprecated version.”</p></sec><sec><title>1.3 Error #3: Bad statistical advice</title><p>This is the most dangerous error, because the code works, but the analysis is wrong. The LLM suggests an inappropriate test, forgets to check the conditions of application, or interprets the results with too much confidence.</p><p>Typical examples:</p><p>• Suggesting a t-test on data that is clearly not normally distributed, without checking anything</p><p>• Using a chi-square test when the expected counts are less than 5 (the correct choice would be Fisher’s exact test)</p><p>• Comparing four groups in pairs using t-tests without correcting for multiple testing</p><p>• Interpreting a p-value &lt; 0.05 as “evidence of an effect” without considering power or effect size</p><p>How to spot it:</p><p>No errors or warnings are returned! That’s why you need to be vigilant. Always ask the LLM: “What are the conditions for applying this test? How can they be verified?”</p><p>Rule of thumb:</p><p>Code alone isn’t enough. Before applying a test, understand why this particular test is being used, not another. If you’re unsure, it’s time to seek expert human advice!</p></sec></sec><sec><title>2. The Three-Step Prompting Method</title><p>The quality of the code an LLM returns depends 80% on the quality of your prompt. A sloppy prompt yields generic code that’s poorly suited to your data and will require three rounds of rework. A structured prompt often yields code that’s usable on the first try.</p><p>The method consists of three parts: context + objective + expected format.</p><sec><title>2.1 Step 1: Context: Describe your data and your environment</title><p>The LLM cannot see your screen. It knows nothing about your table’s structure, the packages you use, or the version of R you have installed. If you don’t tell it anything, it will guess—and not always correctly.</p><p>What you need to provide:</p><p>• <bold>The nature of the dataset</bold>: how many rows, how many columns, what type of data (numeric, categorical, dates…)</p><p>• <bold>The exact names of the columns</bold> relevant to your question</p><p>• <bold>The package(s)</bold> you want to use (tidyverse? base R? ggplot2?)</p><p>• <bold>The data structure</bold>, not the data itself (we’ll get to that next)</p><p><xref ref-type="table" rid="table-w93aqk">Confitiality</xref></p><table-wrap id="table-w93aqk" ignoredToc=""><label>Confitiality</label><table frame="box" rules="all"><tr><td colspan="1" valign="top" align="left">Do not paste your actual data into the LLM</td></tr><tr><td colspan="1" valign="top" align="left">This is a habit you should adopt from the very beginning. If you’re working with medical, HR, financial, educational, or customer data, or any other sensitive content, you are not permitted (either legally or ethically) to send it to ChatGPT, Claude, or Copilot. This data is sent to third-party servers and may be used to train future models. Even when it’s not illegal, it’s a bad practice.</td></tr></table></table-wrap><p>What to do instead:</p><p>• <bold>Describe the structure:</bold> “I have a numeric age column, a 4-category diagnosis column, and a date_inclusion column in Date format.”</p><p>• <bold>Paste the output of `str(data)` or `glimpse(data)`:</bold> It shows the data types and a few examples, without revealing the entire content.</p><p>• <bold>Create a small fictional dataset</bold> that resembles yours, with five made-up rows that share the same structure.</p><p>• <bold>Anonymize the data</bold> if you absolutely must show an excerpt (replace names, scramble identifiers, round off sensitive values).</p><p>Example of a well-defined context, without data leakage:</p><p>“I have a 320-row, 8-column ‘patients’ data frame, imported using read_csv(). The relevant columns are age (numeric, between 18 and 92), gender (2-level categorical: F/M), and systolic_blood_pressure (numeric, with about 5% NA). I’m working with the tidyverse.”</p><p>The LLM has everything it needs to write correct code for you, without having seen a single row of your table.</p><p>2.2 Step 2: The goal: Say what you want to achieve, not how</p><p>When we’re just starting out, we tend to write our prompts as technical requests:</p><p>“How do I do a group_by() followed by a summarize() with mean()?”</p><p>This isn’t a good approach because you’re imposing a solution on the LLM before it has even understood your need. And if your solution isn’t the right one, it will code it for you anyway!</p><p>The objective should instead describe the expected result, allowing the LLM to choose the function.</p><p>Avoid:</p><p>“Give me a mutate() with case_when() to create an age_category variable.”</p><p>Instead, try:</p><p>“I want to create a new column that classifies patients into three age groups: under 40, 40 to 65, and over 65.”</p><p>The second phrasing allows the LLM to propose the cleanest solution. The first one locks it into a choice that may not be optimal.</p></sec><sec><title>2.3 Step 3: The expected format: Specify how you want the answer</title><p>This is a step that’s often overlooked, but it will save you time. If you don’t specify anything, the LLM will respond with a long block of explanations, alternatives, “there’s also…,” and you’ll have to dig through it to find the useful code.</p><p>What you can ask for:</p><p>• <bold>Code only</bold>, without explanations (“respond only with the code block, without comments”)</p><p>• <bold>Code commented line by line</bold> if you want to learn</p><p>• <bold>Multiple versions</bold> (“suggest two ways to do this: one using base R, one using tidyverse”)</p><p>• <bold>A specific output format</bold> (“the result must be a data frame with exactly 3 columns: group, mean, standard deviation”)</p><p>Example:</p><p>“Respond with a single block of tidyverse code, commented in English that produces a data frame sorted by descending mean.”</p><p>The assembled prompt:</p><p>Here’s what a complete prompt following the method looks like:</p><p><bold>Background:</bold> I have a “patients” data frame with 320 rows and 8 columns, containing the variables age (numeric), sex (categorical: F/M), and systolic_blood_pressure (numeric, with a few NA values). I am working with the tidyverse.</p><p><bold>Objective:</bold> I want to create a new column, age_category, that classifies patients into three age groups: under 40, 40 to 65, and over 65.</p><p><bold>Expected format:</bold> A single block of tidyverse code, commented in English, that adds this new column to the existing data frame.</p></sec><sec><title>2.3.1 <xref ref-type="table" rid="table-k2420z">Tip</xref></title><table-wrap id="table-k2420z" ignoredToc=""><label>Tip</label><table frame="box" rules="all"><tr><td valign="top" align="left" colspan="1">Dictate your prompts</td></tr><tr><td colspan="1" valign="top" align="left">Writing a structured prompt can be time-consuming, but you can use voice dictation. On a smartphone, the microphone icon on the keyboard works very well. On a computer, ChatGPT and Claude have a built-in microphone button.</td></tr></table></table-wrap><p>The benefit isn’t just speed (you can dictate 3 to 4 times faster than you can type). It’s also that <bold>you phrase things more naturally</bold>. When speaking, you spontaneously explain the context, what you want, and how you want it. It’s exactly the three-part structure, but without conscious effort.</p><p>You can simply say, “So here’s the thing: I have a table of 320 patients with columns for age, gender, and blood pressure. I’d like to create a new column that classifies patients into three age groups—under 40, 40 to 65, and over 65—and just give me the tidyverse code with comments in English.” The LLM understands this spoken language very well, and you’ll get just as precise a response as with a carefully written prompt.</p></sec><sec><title>2.3.2 Why does it work?</title><p>This structure forces the LLM to focus on your specific problem, not on the generic problem it thinks it recognizes. It reduces hallucinations (as seen in Section 1) because by providing context, you’re implicitly telling it, “Don’t give me a function that doesn’t apply to this data.”</p><p>With a little practice, dictating a structured prompt takes 20 seconds and saves you 10 minutes of debugging.</p><p>Rule of thumb:</p><p>Before sending your prompt, reread it and check that it contains all three blocks. If one is missing, add it. This habit will become automatic in a few days.</p></sec></sec><sec><title>3. How Do You Verify That the Generated Code Actually Works?</title><p>The LLM has returned a nice block of code. It looks clean and well-indented, with reassuring comments. The temptation is to copy and paste it into your script and move on.</p><p>That’s exactly when the trouble can start.</p><p>Code can run without errors and still produce the completely wrong result. So verification isn’t a luxury! Here are the four checks to perform in sequence.</p><sec><title>3.1 Check 1: Does the code run without errors or warnings?</title><p>• <bold>Run the entire block</bold>, not line by line. Some errors only appear in context.</p><p>• Read the console: not just the last line, but also the intermediate messages.</p><p>• <bold>Distinguish between the three types of output</bold>:</p><p>- An <bold>error</bold> (Error in...): The code stops, and you see it immediately.</p><p>- A <bold>warning</bold> (Warning message:): The code has finished, but R reports a problem. Do <bold>not ignore it</bold>. This is often where deprecated functions, silently introduced NaNs, or questionable type conversions are hidden.</p><p>- A <bold>message</bold> (plain text without a prefix): generally informative, but sometimes important (“Joining with by = ...” may reveal a join performed on the wrong column).</p></sec><sec><title>3.2 Check 2: Does the result have the correct form?</title><p>Tip : If you see a warning and don't understand it, paste it intor the LLM and ask, "What does this warning mean, and do I need to fx it"</p><p>Three quick checks:</p><p>• <bold>dim()</bold> or <bold>nrow()</bold>: How many rows and columns? Does this number make sense? If you were expecting a summary by group with three groups and you get 320 rows, something is wrong. (<xref rid="figure-mgyssw" ref-type="fig">figure 1</xref>)</p><p>• <bold>head()</bold>: What do the first few rows look like? Are the columns what you expected?</p><p>• <bold>str()</bold> or <bold>glimpse()</bold>: Are the data types correct? A date stored as a character, a factor stored as numeric, a variable that’s supposed to be an integer but is a double with strange decimals—these are all signs that something went wrong earlier in the process.</p><fig id="figure-mgyssw" ignoredToc=""><label>Figure 1</label><caption><p>Dimensions</p></caption><graphic mime-subtype="png" mimetype="image" xlink:href="http://bdd.rdplf.org/index.php/bdd/article/download/87112/78219/185155"><alt-text>Image</alt-text></graphic></fig></sec><sec><title>3.3 Check 3: Are the values plausible? </title><p>The code runs, and the result has the right format. But are the numbers themselves credible?</p><p>This is where your domain knowledge becomes essential—and it’s something an LLM lacks.</p><p>Some questions to ask yourself:</p><p>• <bold>Are the orders of magnitude correct?</bold> An average systolic blood pressure of 1,200 or 12 mmHg is suspicious. An average age of 450 years is too.</p><p>• <bold>Do the summed numbers match the expected total?</bold> If you group 320 patients by gender and get 180 + 90 = 270, 50 people are missing somewhere (likely unmanaged NA cases).</p><p>• <bold>Are there any absurd values:</bold> negatives where they’re impossible, percentages over 100, dates in 1900 or 2087?</p><p>• <bold>Are there any unexpected NA values?</bold></p><p>Two tools are very useful for answering these questions.</p><p>The first is the summary() function (<xref ref-type="fig" rid="figure-4phh2s">figure 2)</xref>. Applied to an entire data frame, it gives you the minimum, maximum, median, mean, quartiles, and number of NAs for each numeric column.</p><p>For categorical columns, it gives you the counts per category. With a single command, you can see outliers, skewed distributions, and missing values at a glance.</p><p>If you just want to count the NAs column by column, colSums(is.na(data)) does the job more directly.</p><fig id="figure-4phh2s" ignoredToc=""><label>Figure 2</label><caption><p>Summary function</p></caption><graphic mime-subtype="png" mimetype="image" xlink:href="http://bdd.rdplf.org/index.php/bdd/article/download/87112/78219/185156"><alt-text>Image</alt-text></graphic></fig><p>The second is the RStudio viewer <xref ref-type="fig" rid="figure-1">(figure 3</xref>). Click on the data frame name in the Environment tab (top right), or type View(data) in the console. The table opens in a tab, where you can click on the header of any column to sort the values in ascending or descending order.</p><fig id="figure-1" ignoredToc=""><label>Figure 3</label><caption><p>R-studio viewer</p></caption><graphic mime-subtype="png" mimetype="image" xlink:href="http://bdd.rdplf.org/index.php/bdd/article/download/87112/78219/185157"><alt-text>Image</alt-text></graphic></fig><p>This is very handy for spotting, in just two clicks, an absurd maximum value, a negative number that shouldn’t exist, or a birthdate in 1850. You can also use the small search bar at the topright of the viewer to quickly filter rows containing a specific value. If something seems off, don’t validate it. Go back to the code, or ask the LLM to explain it line by line.</p></sec><sec><title>3.4 Verification 4: Testing on a known mini-example</title><p>Rather than blindly trusting the result across your 320 lines, apply the code to a mini dataset where you know the answer in advance.</p><p>Example:</p><p>The LLM has written code for you to calculate the average voltage by gender with NA handling. Before applying it to your real data, create a dummy dataset:</p><p>test &lt;- data.frame(</p><p>sexe = c(«F», «F», «F», «M», «M», «M»),</p><p>tension = c(120, 130, NA, 140, 150, 160)</p><p>)</p><p>You know in advance that the expected average is 125 for women (ignoring the NA) and 150 for men. If the code returns these two numbers, it is probably correct. If it returns something else, for example, 83 for women (because the NA was counted as 0), you have found a bug before it affects your actual analysis.</p><sec><title>3.4.1 The overall check</title><p>Let’s recap the checks to perform:</p><p>1. Does the code run without errors or warnings?</p><p>2. Does the result have the correct dimensions and data types?</p><p>3. Are the values plausible?</p><p>4. Does the test on a known mini-example give the expected result?</p><p>If even one of these four checks fails, do not approve the code. Go back to it with the LLM, ask it for explanations, or check the official documentation (we’ll discuss this in Section 4).</p></sec></sec></sec><sec><title>4. When to Use an LLM, When to Prefer the R Documentation, and When to Ask a Human?</title><p>The LLM is a fantastic tool, but it’s not the only one, and it’s not always the best.</p><p>Many beginners fall into the opposite trap from what we did a few years ago: Instead of searching for everything on Google, they ask ChatGPT about everything, including topics for which other resources are faster, more reliable, or more educational.</p><p>Here’s a simple guide to help you choose the right channel based on your question.</p><sec><title>4.1 Use an LLM when…</title><p>• You know what you want to do, but not how to write it in R: “I want to convert my table from wide format to long format, by date variable.” The LLM produces a suitable pivot_longer() in seconds.</p><p>• You want to explore several approaches: “Give me three different ways to visualize the distribution of a numeric variable.” The LLM is an excellent generator of alternatives.</p><p>• You need to decode an error message. Paste the error and the code, and ask for an explanation. It’s often faster than searching on Stack Overflow.</p><p>• You want to translate code from one “dialect” to another. Switch from base R to the tidyverse, or vice versa.</p><p>• You want to quickly generate repetitive code. A loop that produces 20 similar plots, a script that renames 40 columns according to a pattern—the LLM saves you a ton of time. Note that GitHub Copilot is also a good option in this situation.</p><p>• You want a comment or an explanatory note on a block of code you’ve written to verify your understanding.</p></sec><sec><title>4.2 Choose R documentation when…</title><p>The official documentation remains irreplaceable, and too few beginners consult it. Here’s when to prioritize it:</p><p>• You want to understand exactly what a function does. Type “?function_name” in the console: You’ll get the exact list of arguments, their default values, the return type, and often reproducible examples at the bottom of the page. It’s the definitive source.</p><p>• The LLM has given you working code, but you want to know if a different option might be better. The function’s help lists all the arguments, whereas the LLM often only mentions the most common ones.</p><p>• You are working with a specialised package (epidemiology, time series, geostatistics, etc.). Many of these packages have vignettes (detailed instructional documents) accessible via `browseVignettes(‘package_name’)`. These are written by the authors, are up to date, and are often worth ten prompts.</p><p>• You want to check for potentially obsolete syntax (see Chapter 1). The documentation displays</p><p>deprecation warnings and indicates the replacement function.</p><p>• You are looking for a comprehensive list of a package’s functions. Type help(package =</p><p>‘package_name’) or visit the package’s website (often a very comprehensive pkgdown).</p></sec><sec><title>4.3 Ask a human when…</title><p>I recommend consulting a competent professional (colleague, supervisor, statistician, specialist forum) in the following cases:</p><p>• Choosing a statistical method for your specific problem. Which test? Which model? Which correction for multiple comparisons? The LLM will give you a plausible answer, but the right choice depends on your study design, the nature of your variables, the assumptions you can or cannot verify, and the actual scientific question. This is exactly the kind of decision where bad advice goes unnoticed — and where the consequences can be significant (see section 1, Error No. 3).</p><p>• Interpreting your results. An LLM can describe what a p-value generally means. It cannot tell you whether, in your context, your result is robust, biased, or trivial (in any case, you are taking a risk).</p><p>• Any question involving sensitive data that you cannot share with an LLM (see section 2). A human subject to the same confidentiality obligations (colleague, supervisor) can view the actual data — an LLM cannot.</p><p>• Key methodological decisions: experimental design, sample size, analysis plan, choice of protocol. These decisions shape your entire study. They warrant a proper discussion with someone who knows your field.</p><p>• When you have a hunch that something is amiss, but cannot put your finger on what it is. This intuition is important, and it is best discussed with a human who can ask the right questions in return.</p></sec></sec><sec><title>5. Conclusion</title><p>There you have it—you now have the four essential best practices for turning ChatGPT or Claude into a true R assistant, rather than just a code generator that you copy and paste blindly:</p><p>1. Be aware of the three typical LLM errors: hallucinated functions, obsolete syntax, and, above all, bad statistical advice.</p><p>2. Structure your prompts into three blocks: context, objective, and expected format, without ever pasting sensitive data.</p><p>3. Systematically verify that the code produces the correct result, not just that it runs without errors.</p><p>4. Choose the right channel based on your question: LLM for “how-to” questions, R documentation for precision, and a human for methodological decisions.</p><p>These habits will become second nature after a few weeks of practice. At that point, you’ll be in the ideal situation: comfortable enough with R to distinguish a good answer from a bad one, and methodical enough with LLMs to use them without getting lost.`</p><p>LLMs don’t replace learning R; they accelerate it, provided you stay in control of what you’re doing. That’s exactly the spirit in which I designed my courses: to make you self-reliant, not dependent on a tool.</p><p><bold>ORCID</bold> iD</p><p>Claire Della-Vedova : https://orcid.org/0000-0002-1956-6579</p><p>APPENDIX I</p><p><bold>2-HOUR 15-MINUTE VIDEO TRAINING</bold><bold>accessible and designed for self-learners:</bold></p><p><bold>Language:</bold> French</p><p>Specifically, you will learn to:</p><p>- Work efficiently in RStudio, with well-organized projects</p><p>- Master the basics of the R language</p><p>- Import your own data without any issues (CSV/Excel files)</p><p>- Filter, transform, and summarize a dataset with dplyr</p><p>- Explore your data with clear summary tables</p><p>- Produce clear and polished graphs</p><p>And that’s not all—the course also includes:</p><p>- ready-to-use cheat sheets (including a mind map of the modules)</p><p>- the complete training script</p><p>- datasets for practice</p><p>- transcripts of the videos</p><p>- a mini-guide to best practices for turning ChatGPT or Claude into a real R assistant</p><p><ext-link ext-link-type="uri" xlink:href="https://5ij4c.r.a.d.sendibm1.com/mk/cl/f/sh/1f8JIKXwHGYox7ga29hkL4BbYR/nXfUB0nUcoTe" xlink:title="Check out the course and click here">Check out the course and click here</ext-link></p><p>Use Discount code (39€ instead of 49€) for readers of this article: LECTEURBDD</p></sec></body><back><sec><title>Funding</title><p>The author received no funding for this article.</p></sec><sec sec-type="author-contributions"><title>Author Contributions</title><p>AClaire Della-Vedova designed and wrote this article entirely on her own.</p></sec><sec sec-type="ethics-statement"><title>Ethics Statement</title><p>not applicable</p></sec><ref-list><title>References</title><ref id="BIBR-1"><element-citation publication-type="journal"><article-title>Introduction à l’analyse de données avec le logiciel R</article-title><person-group person-group-type="author"><name><surname>C</surname><given-names>Della Vedova</given-names></name></person-group><comment>Bull Dial Domic [Internet]. 16 juin 2019 [cité 27 mai 2026];2(2):75-88. doi:</comment><pub-id pub-id-type="doi">10.25796/bdd.v2i2.20513</pub-id></element-citation></ref><ref id="BIBR-2"><element-citation publication-type="journal"><article-title>Introduction à la data visualisation sous R, avec l’add in Esquisse: formation à l’utilisation du logiciel statistique R</article-title><person-group person-group-type="author"><name><surname>C</surname><given-names>Della Vedova</given-names></name></person-group><comment>Bull Dial Domic [Internet]. 17 août 2019 [cité 27 mai 2026];2(3):165-74. doi:</comment><pub-id pub-id-type="doi">10.25796/bdd.v2i3.21313</pub-id></element-citation></ref><ref id="BIBR-3"><element-citation publication-type="journal"><article-title>Réaliser des tableaux de bord avec le logiciel R</article-title><person-group person-group-type="author"><name><surname>C</surname><given-names>Della Vedova</given-names></name></person-group><comment>Bull Dial Domic [Internet]. 7 sept. 2020 [cité 27 mai 2026];3(3):177-90. doi:</comment><pub-id pub-id-type="doi">10.25796/bdd.v3i3.58203</pub-id></element-citation></ref><ref id="BIBR-4"><element-citation publication-type="journal"><article-title>Initiation au Logiciel de statistiques R : réalisez vos premières visualisations avec le package ggplot2</article-title><person-group person-group-type="author"><name><surname>C</surname><given-names>Della Vedova</given-names></name></person-group><comment>Bull Dial Domic [Internet]. 15 déc. 2019 [cité 27 mai 2026];2(4):229-38. doi:</comment><pub-id pub-id-type="doi">10.25796/bdd.v2i4.52303</pub-id></element-citation></ref><ref id="BIBR-5"><element-citation publication-type="journal"><article-title>Initiation au Logiciel de statistiques R : Initiation à Rmarkdown</article-title><person-group person-group-type="author"><name><surname>C</surname><given-names>Della Vedova</given-names></name></person-group><comment>Bull Dial Domic [Internet]. 13 avr. 2020 [cité 27 mai 2026];3(1):51-66. doi:</comment><pub-id pub-id-type="doi">10.25796/bdd.v3i1.54523</pub-id></element-citation></ref><ref id="BIBR-6"><element-citation publication-type="journal"><article-title>Initiation à la manipulation de données avec le package dplyr</article-title><person-group person-group-type="author"><name><surname>C</surname><given-names>Della Vedova</given-names></name></person-group><comment>Bull Dial Domic [Internet]. 15 juin 2020 [cité 27 mai 2026];3(2):93-109. doi:</comment><pub-id pub-id-type="doi">10.25796/bdd.v3i2.55463</pub-id></element-citation></ref></ref-list></back></article>