Rstudio running in console in Rmd chunk

南笙酒味 提交于 2020-02-05 06:26:50

问题


I recently updated to Rstudio version 1.0.136 coming from 0.99.902 if I'm not mistaken. One of the things that used to work and doesn't anymore is to run parts of the code in the chunk in the console and get the output (plot) in the plot section of the Rstudio environment.

Here is the code I'm using, inside of a .Rmd file:

```{r, echo=FALSE, message=FALSE, warning=FALSE, results='hide', message=FALSE}
attach(mtcars)
plot(wt, mpg) 
```

What I do is select the two lines inside the chunk, and press Ctrl+Enter, the command to run the selected lines in the console. Previously this outputted a plot to the 'Plots' tab, from which I can export it with the desired size etc.

However with the new version the plot does not show up here anymore when using Ctrl+Enter, just copy/pasting the code into the console still works obviously. What changed and how can I get it back to work without switching back to the previous version of Rstudio?


回答1:


You need to check Chunk output in console under the settings button (grey sprocket).



来源:https://stackoverflow.com/questions/41889728/rstudio-running-in-console-in-rmd-chunk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!