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: Open help for selection` fails for some functions

See original GitHub issue

Describe the bug

r.helpPanel.openForSelection (R: Open help for selection) sometimes fail to work although documentation-on-hovering does.

See the example below where I cannot use the command to open the documentation for glmnet::glmnet(), although the documentation shows when hovering (via the language server), and also opens up correctly when I execute ?glmnet. This also happens for instance with the function bag() from the caret package, so this is not a problem only with functions named exactly as the package. For the built-in function lm() and also for other functions such as ggplo2::geom_point() the command works fine.

help-shortcut-fail

To Reproduce Steps to reproduce the behavior:

  1. Open an .R file.
  2. Write the name of a function in the file.
  3. Highlight the function name and select R: Open help for selection from the command tool box.
  4. See error

Do you want to fix by self? (We hope your help!)

Yes, I’ll take a look at it.

setting.json:

{
    "r.rterm.linux": <path-to-radian>,
    "r.sessionWatcher": true,
    "r.rmarkdown.codeLensCommands": [
        "r.runCurrentChunk",
        "r.runAboveChunks",
        "r.runAllChunks"
    ],
    "r.bracketedPaste": true
}

Expected behavior

I expected the documentation to open up.

Environment (please complete the following information):

  • OS: Linux
  • VSCode Version: 1.56.2
  • R Version: 4.0.5
  • vscode-R version: 1.6.8

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
ManuelHentschelcommented, Jun 4, 2021

Does calling “Clear Cached Index Files & Restart Help Server” in the R sidebar do anything?

1reaction
ManuelHentschelcommented, Jun 4, 2021

Glad to hear this worked. If you frequently run into this issue, you can set "r.helpPanel.cacheIndexFiles": "None" (we could also use this as default to avoid confusion, not sure how the performance of the the help viewer is for other users).

As a side note, usually you don’t need to select the entire word you want to look up, having the cursor inside the word should be enough.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Opening R help function
I am running Windows 10 Pro on a 64-bit machine. I am using the latest version of R but have difficulty opening help...
Read more >
22 Debugging | Advanced R - Hadley Wickham
A good strategy helps. Below I outline a four step process that I have found useful: Google! Whenever you see an error message,...
Read more >
Getting Help with R
The help() function and ? help operator in R provide access to the documentation pages for R functions, data sets, and other objects,...
Read more >
Things to Try When your R Code Fails
If your R code is broken or produces errors while running in RStudio, try the following: As I've mentioned in Everything You Need...
Read more >
R Debug - Essential Principles and Functions that you can't ...
Here we will discuss about fundamental principles of R debugging and its different functions in R programming with the help of examples.
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