Skip to content

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

Description

@snotman

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions