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 session watcher does not work

See original GitHub issue

I tried the following code with the session watcher open

library(tidyverse)
ggplot(data = mpg) + geom_point(mapping = aes(x = displ, y = hwy))

but it does not prompt anything.

image image

I read about #179… but it seems not my problem

here is some more information might be useful.

> ls.str(getOption("vscodeR"))
attach : function ()  
dataview : function (x, title)  
dataview_data_type : function (x)  
dataview_table : function (data)  
dir :  chr "/Users/macone/Documents/learn-R/.vscode/vscode-R"
dir_plot_history :  chr "/var/folders/0v/_qjsr_1j6yv2z49b9r94grp40000gn/T//RtmpFyr0GP/images"
dir_session :  chr "/Users/macone/Documents/learn-R/.vscode/vscode-R/20992"
globalenv_file :  chr "/Users/macone/Documents/learn-R/.vscode/vscode-R/20992/globalenv.json"
new_plot : function ()  
pid :  int 20992
platform : List of 8
 $ OS.type   : chr "unix"
 $ file.sep  : chr "/"
 $ dynlib.ext: chr ".so"
 $ GUI       : chr "vscode"
 $ endian    : chr "little"
 $ pkgType   : chr "mac.binary"
 $ path.sep  : chr ":"
 $ r_arch    : chr ""
plot_file :  chr "/Users/macone/Documents/learn-R/.vscode/vscode-R/20992/plot.png"
plot_history_file :  NULL
plot_updated :  logi FALSE
rebind : function (sym, value, ns)  
respond : function (command, ...)  
response_file :  chr "/Users/macone/Documents/learn-R/.vscode/vscode-R/response.log"
tempdir :  chr "/var/folders/0v/_qjsr_1j6yv2z49b9r94grp40000gn/T//RtmpFyr0GP"
unbox : function (x)  
update : function (...)
> Sys.getenv("R_USER")
[1] ""
> getwd()
[1] "/Users/macone/Documents/learn-R"

Thank you

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
renkun-kencommented, May 1, 2020

The plot is printed because in an interactive session when you input an expression, the result will be printed, and ggplot2 graphics is only created when you print the result.

If you need the produce the plot in source, you may need the following:

plot <- ggplot(...)
print(plot)
0reactions
fdq09ecacommented, May 1, 2020

The plot is printed because in an interactive session when you input an expression, the result will be printed, and ggplot2 graphics is only created when you print the result.

If you need the produce the plot in source, you may need the following:

plot <- ggplot(...)
print(plot)

ah… blimy

The plot is printed because in an interactive session when you input an expression, the result will be printed, and ggplot2 graphics is only created when you print the result.

If you need the produce the plot in source, you may need the following:

plot <- ggplot(...)
print(plot)

for whom may interest, without having print(.), cmd+enter can have the same result

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing R in VSCode: Interacting with an R session - Kun Ren
The latest vscode-R implements an experimental feature called R session watcher, which makes it possible for VSCode to communicate with any ...
Read more >
visual studio code - R - VScode issues - Stack Overflow
Whenever I try to run R code this error pops up. VSCode R Session Watcher requires jsonlite, rlang. Please install manually in order...
Read more >
How to set up VSCode for R - YouTube
R users: Do you want to be ready for GitHub Copilot? Then you'll need to write your R code in Microsoft's Visual Studio...
Read more >
Setting up R in Visual Studio Code · Markov Wanderer
However, Visual Studio Code does a lot more than just R, and has ... the following changes: enable R Bracketed Paste, R Session...
Read more >
A fresh start for R in VSCode - Medium
When I searched the internet on how to do that, to my awe there was no article or YouTube video which tells how....
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