Data not showing up in global environment in Visual Studio Code with R extension

371 Views Asked by At

I am using Visual Studio Code with the R extension, but I’m having trouble getting my data to show up in the global environment. When I run a script that creates a data frame, I can see the output in the console, but the data frame is not visible in the global environment tab. issues

I also get the following error messages in the Problems panel:

  • Cannot register 'r.rpath.windows'. This property is already registered.
  • Cannot register 'r.rpath.mac'. This property is already registered.
  • Cannot register 'r.rpath.linux'. This property is already registered.

Here is the content of my settings.json file:

  • "r.rpath.mac": "/usr/local/bin/r",
  • "r.bracketedPaste": true,
  • "r.rterm.mac": "/Library/Frameworks/Python.framework/Versions/3.11/bin/radian",
  • "r.plot.useHttpgd": true,
  • "r.workspaceViewer.showObjectSize": true

Can anyone help me fix this issue? Thanks!

1

There are 1 best solutions below

0
SAL On

From your image, I see in the status bar that R has not been attached to active terminal: R:(not attached). Try to click on the icon and attach R to active terminal. If your current R is attached (e.g, if you see some thing like R 4.3.1 or the R version currently installed on your system), then from the primary side bar in the right side of the vscode click on R icon and look up the Global Environment under Workspace where the data are stored. You must see the data there.

#Or 

If the option above doesn't successful, try to kill the current terminal and go to the terminal menu and create new terminal.

I had similar issue and was able to solve the issue as what I explained. Hope these could help.