Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R Studio opens data frames unprompted when running code

Tags:

r

rstudio

Since a few months ago I have a problem when using R studio: Sometimes when I run code (whole chunks or just single lines) and make changes in a data frame, R studio automatically opens the manipulated/ generated data frame, without being prompted to do so with View(dataframe) or similar. I cannot detect any patterns, i.e. it seems to happen randomly, independent of the manipulation or function used. Usually, it happens again whenever the same line is run again in the same session, but sometimes stops if the session is restarted.

I recently updated both R and R studio and use R version 4.2.3 (2023-03-15) and R studio Version 2023.03.0+386 (2023.03.0+386) on macOS 13.2.1.

Is there a way of stopping R studio from opening data frames unprompted while running a script?

like image 777
Em Laskey Avatar asked Feb 14 '26 14:02

Em Laskey


1 Answers

If you hold down Ctrl and click on the name of the data.frame inside an R script (i.e. Source, not Console), it will automatically run View(my.df) where my.df is the name of the data.frame.

I suspect you are accidentally pressing Ctrl as you select code containing data.frames, or you have a sticky/faulty Ctrl key (or whatever the equivalent is on Mac with your assigned keyboard shortcuts).

like image 104
Earlien Avatar answered Feb 17 '26 04:02

Earlien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!