jalvesaq / Nvim-R

Vim plugin to work with R
GNU General Public License v2.0
968 stars 126 forks source link

Cannot start R: nvimrserver not running #812

Closed oTheAnalyst closed 7 months ago

oTheAnalyst commented 7 months ago

I'm running Arch Linux I had an update recently that blew up my config, I'm just trying to narrow down where the issue is located.

this is what I get when I run Rdebuginfo

Time
  before_nrs.R: 
0.348031
  common_global.vim: 
0.001395
  start_R: 
[79, 1995547321]
  GlobalRInit: 
0.030015
before_nrs.R stderr
Error in loadNamespace(x) : there is no package called ‘httpgd’ Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart Execution halted 

below is my R profile config

view_xl <- function(.data) {
  if (interactive()) {
    tmp <- tempfile(fileext = ".csv")
    data.table::fwrite(.data, tmp)
    browseURL(tmp, browser = "gnumeric")
  }
}

httpgd::hgd()

options(browser = "brave")

options(reactable.theme = reactable::reactableTheme(
  color = "hsl(233, 9%, 87%)",
  backgroundColor = "#002b36",
  borderColor = "#eee8d5",
  stripedColor = "#586e75",
  highlightColor = "#6c71c4",
  inputStyle = list(backgroundColor = "hsl(233, 9%, 25%)"),
  selectStyle = list(backgroundColor = "hsl(233, 9%, 25%)"),
  pageButtonHoverStyle = list(backgroundColor = "hsl(233, 9%, 25%)"),
  pageButtonActiveStyle = list(backgroundColor = "hsl(233, 9%, 28%)")
))

view <- function(.data) {
  if (interactive()) {
    # Use a temporary HTML file to display the table
    tmp <- tempfile(fileext = ".html")

    # Write the reactable output to the temporary HTML file
    html <- reactable::reactable(.data,
      filterable = TRUE,
      searchable = TRUE,
      showPageSizeOptions = TRUE,
      striped = TRUE,
      highlight = TRUE,
      compact = TRUE,
      defaultPageSize = 30
    )
    htmlwidgets::saveWidget(html, file = tmp)

    # Open the temporary HTML file in Brave browser
    # Replace "firefox" with the path to the firefox executable if necessary
    browseURL(tmp, browser = "brave")
  }
}

options(width = 100)
.libPaths(c(.libPaths(), "~/Rpackages/"))
.libPaths(c(.libPaths(), "~/R/x86_64-pc-linux-gnu-library/4.3/"))

print(".Rprofile loaded successfully")

If you have any idea what is going on feedback would be appreciated, I'm somewhat lost on how to diagnosis this issue.

jalvesaq commented 7 months ago

This

httpgd::hgd()

perhaps should be


if (interactive()) {
    httpgd::hgd()
}
oTheAnalyst commented 7 months ago

that returns this.


Time
  before_nrs.R: 
0.288396
  common_global.vim: 
0.001325
  GlobalRInit: 
0.027089
before_nrs.R stderr
Error in loadNamespace(x) : there is no package called ‘reactable’ Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart Execution halted 
oTheAnalyst commented 7 months ago
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called ‘reactable’
Calls: options ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted

I tried to install the missing package and got this, trying to see what else I can do.

jalvesaq commented 7 months ago

Try this ~/.Rprofile:

options(width = 100)
.libPaths(c(.libPaths(), "~/Rpackages/"))
.libPaths(c(.libPaths(), "~/R/x86_64-pc-linux-gnu-library/4.3/"))

if (interactive()) {
  view_xl <- function(.data) {
    tmp <- tempfile(fileext = ".csv")
    data.table::fwrite(.data, tmp)
    browseURL(tmp, browser = "gnumeric")
  }

  httpgd::hgd()

  options(browser = "brave",
    reactable.theme = reactable::reactableTheme(
      color = "hsl(233, 9%, 87%)",
      backgroundColor = "#002b36",
      borderColor = "#eee8d5",
      stripedColor = "#586e75",
      highlightColor = "#6c71c4",
      inputStyle = list(backgroundColor = "hsl(233, 9%, 25%)"),
      selectStyle = list(backgroundColor = "hsl(233, 9%, 25%)"),
      pageButtonHoverStyle = list(backgroundColor = "hsl(233, 9%, 25%)"),
      pageButtonActiveStyle = list(backgroundColor = "hsl(233, 9%, 28%)")
  ))

  view <- function(.data) {
    # Use a temporary HTML file to display the table
    tmp <- tempfile(fileext = ".html")

    # Write the reactable output to the temporary HTML file
    html <- reactable::reactable(.data,
      filterable = TRUE,
      searchable = TRUE,
      showPageSizeOptions = TRUE,
      striped = TRUE,
      highlight = TRUE,
      compact = TRUE,
      defaultPageSize = 30
    )
    htmlwidgets::saveWidget(html, file = tmp)

    # Open the temporary HTML file in Brave browser
    # Replace "firefox" with the path to the firefox executable if necessary
    browseURL(tmp, browser = "brave")
  }
}

print(".Rprofile loaded successfully")
oTheAnalyst commented 7 months ago

Try this ~/.Rprofile:

options(width = 100)
.libPaths(c(.libPaths(), "~/Rpackages/"))
.libPaths(c(.libPaths(), "~/R/x86_64-pc-linux-gnu-library/4.3/"))

if (interactive()) {
  view_xl <- function(.data) {
    tmp <- tempfile(fileext = ".csv")
    data.table::fwrite(.data, tmp)
    browseURL(tmp, browser = "gnumeric")
  }

  httpgd::hgd()

  options(browser = "brave",
    reactable.theme = reactable::reactableTheme(
      color = "hsl(233, 9%, 87%)",
      backgroundColor = "#002b36",
      borderColor = "#eee8d5",
      stripedColor = "#586e75",
      highlightColor = "#6c71c4",
      inputStyle = list(backgroundColor = "hsl(233, 9%, 25%)"),
      selectStyle = list(backgroundColor = "hsl(233, 9%, 25%)"),
      pageButtonHoverStyle = list(backgroundColor = "hsl(233, 9%, 25%)"),
      pageButtonActiveStyle = list(backgroundColor = "hsl(233, 9%, 28%)")
  ))

  view <- function(.data) {
    # Use a temporary HTML file to display the table
    tmp <- tempfile(fileext = ".html")

    # Write the reactable output to the temporary HTML file
    html <- reactable::reactable(.data,
      filterable = TRUE,
      searchable = TRUE,
      showPageSizeOptions = TRUE,
      striped = TRUE,
      highlight = TRUE,
      compact = TRUE,
      defaultPageSize = 30
    )
    htmlwidgets::saveWidget(html, file = tmp)

    # Open the temporary HTML file in Brave browser
    # Replace "firefox" with the path to the firefox executable if necessary
    browseURL(tmp, browser = "brave")
  }
}

print(".Rprofile loaded successfully")

This was the fix! Thank you for taking the time to help me out with this!