question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

R markdown code chunk not executable after saving

See original GitHub issue

Describe the bug

The code chunk works perfectly before I named and saved the file. The following code, without naming and saving, can be linted and produce the right plot in vs code plot pane. But the same chunk will be no longer executable, and not linted, after I gave the file a name (such as test.Rmd) and saved the file.

To Reproduce

Steps to reproduce the behavior:

  1. press ctrl+N, choose file type as .Rmd
  2. type in the following code
test <- rnorm(1000)
plot(test)
  1. the code chunk was linted and if you run the code chunk, it works perfectly with a plot pane shows up
  2. save the file with name “test.Rmd
  3. the lint disappeared, and the code chunk was no longer executable.

Do you want to fix by self? (We hope your help!)

No

Expected behavior I would like the code executable after the .Rmd file is named and saved.

Screenshots when unsaved, everything works fine.

problem1-1

after naming and saving, the code chunk is not executable

problem2

Environment (please complete the following information):

  • OS: Windows 10
  • VSCode Version: 1.65.2
  • R Version: 4.1.2
  • vscode-R version: 2.4.0

additional information

This is my first time raising an issue, please let me know if there is anything improper in my request.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aachenercommented, Mar 13, 2022

Confirmed! It worked on my PC.

Actually I did not touch the .jason files, I have no idea where they came from…

Many thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

preventing a chunk run in rmarkdown
I have situation different than above, I want to present the script but should not run in html as this will take very...
Read more >
2.6 R code chunks and inline R code | R Markdown
You can insert an R code chunk either using the RStudio toolbar (the Insert ... is compiled (if the code chunk was not...
Read more >
Trouble with the knit function in R Markdown and difficulty ...
Hello, I have been having some consistent problems with R markdown recently, starting from being unable to save R files as R documents...
Read more >
play button disappears in Rmd files · Issue #6220
Open a default Rmd file in the IDE via File->New File->R Markdown (HTML) ... executable SQL chunks, you need to enable inline code...
Read more >
Chunk options and package options - Yihui Xie
Note that R Markdown has changed this default value to FALSE . When the chunk option include = FALSE , knitr will stop...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found