reprex in Rstudio

170 Views Asked by At

I an unable to get reprex to run. Here is a copy of the console session:

> library(reprex)
> y <- 1:4
> mean(y)
[1] 2.5
> reprex()
Error in file(con, "w") : cannot open the connection
In addition: Warning message:
In file(con, "w") :
  cannot open file 'C:/Users/Richard.R': Permission denied

Note that this is on a machine I do not have admin rights for. Also Richard is not my userid on this machine, it is Richard. followed by my last name.

How can I get reprex to run normally?

1

There are 1 best solutions below

1
On

This looks to be a permission problem. You may not have write access in the current directory. You can see your current directory with getwd()

Please change your current directory with setwd() function to any other directory where you have write access and retry this.