3

Is there a way to force R to delete a file using

unlink()

when its open in R?

When trying to R throws the warning: Warning message: In file.remove(ls) : cannot remove file 'dat.csv', reason 'Permission denied'. I have a large Global Environment, and have difficulties finding the reason that the file is in use.

When i try to delete in using windows, i get the error: the action cannot be completed because the file is open in Rstudio r session.

Alternativly, is there a way to see which entity is blocking the delete?

Jeppe Olsen
  • 968
  • 8
  • 19

1 Answers1

-1

Just use command dev.off() in R. And you will shut down all the underlying running device until the null device. Then it should be ok to open pdf files.

nan hu
  • 11
  • 1