vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

Add support for Viewing `rds` files

Open rkrug opened this issue 2 years ago • 2 comments

I save R objects regularly as rds files, and it would be great to view them as one can with other file types. An example would be the docx viewer which opens tab with a view of the document. This view should be read only, but editing could be a nice plus. This obviously would only work for tabular data. If the data is not tabular, a message could be displayed.

At the moment, I am using readRDS() |> View() in the running R session, but a bild in solution would be really useful.

rkrug avatar Sep 26 '23 07:09 rkrug

Maybe you should consider incorporating a customizable keybinding like this:

    {
        "key": "ctrl+r ctrl+v",
        "command": "r.runCommandWithSelectionOrWord",
        "when": "editorTextFocus && editorLangId == 'r' || editorTextFocus && editorLangId == 'rmd'",
        "args": "utils::View(readRDS($$))"
    }

Yunuuuu avatar Nov 27 '23 07:11 Yunuuuu

Sounds like a solution. I have put this into my keybinding.json. Then I have to press ctrl+r ctrl+v when the rds is selected in the browser panel? I tried this, but it does not work. What am I doing wrong?

rkrug avatar Nov 27 '23 09:11 rkrug