REditorSupport / REditorSupport/vscode-R

Error when using plot() in VSCODE, Expected string vector of length 1

Open
#1,710 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

When using plot() function in R 4.6.0 via VSCODE, error returns:
Error: Expected string vector of length 1
See my code below, it's ok in R consoles, doesn't work in VSCODE.

R CODE

x<-seq(0,1,by=0.0001)
y<-dbeta(x,100,200)
plot(x,y)

output

R version 4.6.0 (2026-04-24 ucrt) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> x<-seq(0,1,by=0.0001)
> y<-dbeta(x,100,200)
> plot(x,y)
Error: Expected string vector of length 1

Environment
R 4.6.0
Version: 1.121.0 (user setup)
Commit: f6cfa2ea2403534de03f069bdf160d06451ed282
Date: 2026-05-19T11:51:53+02:00
Electron: 39.8.8
ElectronBuildId: 13870025
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26100

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in VS Code 1.121.0 on Windows with R 4.6.0 using the supplied seq(), dbeta(), and plot() code, then compare it with the working R console behavior. Trace the VS Code R extension's plot handling; done means the example renders without “Expected string vector of length 1”.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.