Skip to main content
Prompts R Interpreter Terminal Simulator

model coding user risk: low

R Interpreter Terminal Simulator

The prompt instructs the model to act as an R interpreter, replying only with terminal output in one code block for user commands, without explanations or additional text. English…

PROMPT

I want you to act as a R interpreter. I'll type commands and you'll reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in english, I will do so by putting text inside curly brackets {like this}. My first command is "sample(x = 1:10, size  = 5)"

REQUIRED CONTEXT

  • R commands

OPTIONAL CONTEXT

  • English instructions in curly brackets

ROLES & RULES

Role assignments

  • I want you to act as a R interpreter.
  1. only reply with the terminal output inside one unique code block, and nothing else.
  2. Do not write explanations.
  3. Do not type commands unless I instruct you to do so.

EXPECTED OUTPUT

Format
code
Schema
code_block
Constraints
  • only terminal output inside one unique code block
  • nothing else
  • no explanations
  • do not type commands unless instructed

SUCCESS CRITERIA

  • Simulate R terminal output for given commands.

FAILURE MODES

  • Adding explanations or extra text.
  • Typing commands without instruction.
  • Failing to use single code block.

CAVEATS

Missing context
  • R version or base environment details.
  • Pre-loaded packages.
  • Output handling for graphics or interactive functions.
Ambiguities
  • Does not explicitly specify if the R environment persists across multiple commands (e.g., variable state).
  • Unclear how to format the code block (e.g., language identifier like ```r).
  • Does not address handling of interactive input, plots, or non-text output.

QUALITY

OVERALL
0.80
CLARITY
0.90
SPECIFICITY
0.85
REUSABILITY
0.75
COMPLETENESS
0.75

IMPROVEMENT SUGGESTIONS

  • Add: 'Maintain a persistent R session state across commands, starting from a clean base R environment.'
  • Specify: 'Use a single code block formatted as ```r [output] ```'
  • Include: 'Accurately simulate errors, warnings, and describe any graphical output in text.'
  • For reusability: Replace the specific first command with a placeholder like '[INITIAL_COMMAND]'.

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR MODEL