reprex in Rstudio error

after libaray installation,

library(reprex)
(y <- 1:4)
[1] 1 2 3 4
mean(y)
[1] 2.5
reprex()
Rendering reprex...
Error: callr subprocess failed: :18:7: unexpected 'in'
17: #+ reprex-body
18: Error in
^

Hi, and welcome.

Let's try a little recursion, with a reprex of the code rendered with the addin in RStudio IDE

library(reprex)
(y <- 1:4)
#> [1] 1 2 3 4
mean(y)
#> [1] 2.5
reprex()
#> No input provided and clipboard is not available.
#> Rendering reprex...

Created on 2019-11-27 by the reprex package (v0.3.0)

The problem is that reprex() needs something more to work with than the example provides:

x An expression. If not given, reprex() looks for code in input or on the clipboard, in that order.

input Character. If has length one and lacks a terminating newline, interpreted as the path to a file containing reprex code. Otherwise, assumed to hold reprex code as character vector.

Here's what happens if the code to be rendered is on the clipboard

 (y <- 1:4)
#> [1] 1 2 3 4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.