1

after installation the package,

> library(reprex)
> (y <- 1:4)
[1] 1 2 3 4
> mean(y)
[1] 2.5
> reprex()
Rendering reprex...
Error: callr subprocess failed: <text>:18:7: unexpected 'in'
17: #+ reprex-body
18: Error in
          ^
eipi10
  • 81,881
  • 20
  • 176
  • 248
user253546
  • 37
  • 6

1 Answers1

1

I can't tell for sure, but it looks like you might be running code in the console and then running reprex(). Instead, do one of the following

  1. Place your code inside the reprex function:

    reprex({
      (y=1:4)
      mean(y)
    })
    

    You can do this directly in the console or in a script file in the RStudio "source" pane. Then run the code.

  2. Type your code in an R script file in the RStudio source pane:

    (y=1:4)
    mean(y)
    

    Then copy it to the clipboard. Then run reprex() in the console.

Either way, you should then see the following in the Viewer pane. The output below will also have been placed in your clipboard, so that you can paste it into any other location:

enter image description here

eipi10
  • 81,881
  • 20
  • 176
  • 248
  • Thanks. my vote up does not change the publicly displayed post score because I am new to so with less than 15 reputation – user253546 Nov 28 '19 at 08:14