Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reprex() no longer working after updating to R 4.4.0? #462

Closed
strengejacke opened this issue Apr 25, 2024 · 3 comments
Closed

reprex() no longer working after updating to R 4.4.0? #462

strengejacke opened this issue Apr 25, 2024 · 3 comments

Comments

@strengejacke
Copy link

I'm seeing an issue that is new when using the reprex-package. Since this first occurred after updating to R 4.4.0, I'm not sure if this is related?

My setup is VSCode 1.88.1, Windows 11, R 4.4.0 (64 bit).

Code:

reprex::reprex('data(diamonds, package = "ggplot2")')

Output:

"data(diamonds, package = \"ggplot2\")"
#> [1] "data(diamonds, package = \"ggplot2\")"

Error:

ℹ Rendering reprex...
Error in .make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version) :
  invalid non-character version specification 'x' (type: double)
> reprex::reprex('data(diamonds, package = "ggplot2")')
ℹ Rendering reprex...
Error in .make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version) :
  invalid non-character version specification 'x' (type: double)
> traceback()
9: stop(msg, domain = NA)
8: .make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version)      
7: numeric_version(0) at rstudioapi.R#237
6: rstudioapi::versionInfo()
5: is_rstudio_server()
4: reprex_clipboard()
3: expose_reprex_output(reprex_file, rtf = (venue == "rtf"))
2: reprex_impl(x_expr = substitute(x), input = input, wd = wd, venue = venue,       
       render = render, new_session = TRUE, advertise = advertise,
       session_info = session_info, style = style, html_preview = html_preview, 
       comment = comment, tidyverse_quiet = tidyverse_quiet, std_out_err = std_out_err,
       outfile = outfile)
1: reprex::reprex("data(diamonds, package = \"ggplot2\")")
@strengejacke
Copy link
Author

strengejacke commented Apr 25, 2024

This does not seem to happen using RStudio, though. Maybe it's VSCode/R-Editor-Extension related.

@strengejacke
Copy link
Author

Narrowing down a bit: it seems that rstudioapi::versionInfo() throws the error in VSCode. This behaviour is new, after updating to R 4.4.0.
image

@jennybc
Copy link
Member

jennybc commented Apr 29, 2024

Yeah I think you need to report this over in https://github.com/REditorSupport/vscode-R. I think it's this in their rstudioapi shims.

https://github.com/REditorSupport/vscode-R/blob/d582b9184838a32352f624e451d4c1856f347b9c/R/session/rstudioapi.R#L240

Your backtrace seems to be identifying the call is from the shim:

7: numeric_version(0) at rstudioapi.R#237

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants