0

I'm running another program using the system() function in R. I'm feeding in command line features for the other program. When I miscode the parameters, I'll get an error message that I can't delete the associated file because it's still being controlled by the program I called in the system() call.

Is there a way to manually kill these types of processes besides restarting R which is what I'm currently doing?

An example would be something like:

system("python myFile.py")
Gavin Simpson
  • 164,190
  • 25
  • 377
  • 440
screechOwl
  • 25,740
  • 58
  • 153
  • 258

1 Answers1

2

On Windows, you can use TASKKILL command to kill a process.

E.g.

TASKKILL /IM python*
CHP
  • 16,581
  • 4
  • 35
  • 56