RStudio view Values in the Environment


Is it possible to View Values in the Environment by clicking. Instead of writing View() in the console, when I click a value nothing is happening. Does it work only (clicking) with functions and dataframes, lists ?

I would be grateful for help.

Can you clarify a bit more on what you want to do? RStudio does have "Environment" pane where all of the results with name are listed.

Thank you for your reply. I want to do a simple thing if possible. For example if you have a function in an environment panel and you click on it immediately in upper left window ( I believe it is script window) you can see what is inside this function. The same with dataframe and lists. If I click on an object (a value) eg. aaa <- 148, so my object is aaa with a value 148 and if I click on it nothing is happening. But when I write down in console View(aaa) in upper left panel I can see it now in like small table (row and column). Of course this is not difficult to write View(aaa) but I was wondering if by clicking can I get it faster. In previous versions of RStudio if I remember it right it was working.
I hope I did not explained it in a very complicated way.

Hmm, I’m not aware of more object types being clickable in the Environment pane previously. I think there’s been some previous discussion here of the desire to extend clickability to other types of objects (but I can’t find it right now, so maybe I imagined it? :sweat_smile:). There’s also a bit of related discussion on GitHub: Feature request: Shortkey for the View() function · Issue #1861 · rstudio/rstudio · GitHub

This tutorial shows how to do something similar to what you’re looking for with an RStudio addin: RStudio:addins part 3 - View objects, files, functions and more with 1 keypress - Jozef's Rblog


Thank you very much, I will look into it. :slight_smile:

In RStudio version 0.97.248 that was a feature that when you clicked on a value or function in a workspace, it was immediately opened in notepad. Is it still available in current version ?

No, it is no longer available. We're trying to avoid certain features that might encourage a non-reproducible workflow -- if you need to modify the value of a variable, we recommend doing so directly in your R script. If you want to just view the variable's contents, you can try clicking the icon on the right side of the workspace, e.g.

Clicking on that icon at the right would open the mtcars dataset in the Data Viewer.

1 Like

May I ask how viewing Values/Variables by clicking might encourage a non-reproducible workflow ?

I don't think the concern is with viewing an object, it's with opening an editable view that allows you to alter the object in an ad hoc, non-reproducible way (which is what the old feature did). The new icons are still a shortcut to View():

(Note the View() calls in the console — they are the result of me clicking on the icons in the object explorer)

1 Like

Thank you very much indeed for help.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.