Get pid (process ID) of R session from within R session (to attach a debugger)

无人久伴 提交于 2020-01-24 10:17:05

问题


How can I find out the process ID of the current R session my R code is running in?

I am using Ubuntu 18.04, but an answer working on Windows would also be great.


回答1:


There is a command called Sys.getpid() that outputs the session ID directly

Sys.getpid()
#[1] 134164


来源:https://stackoverflow.com/questions/58657784/get-pid-process-id-of-r-session-from-within-r-session-to-attach-a-debugger

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!