in R, how to get the process id of a system call like this one:…
- User
in R, how to get the process id of a system call like this one: system(paste("/local/tNGS_TB/Real-time_wrapper/Amplicon_RT_analyzer_V0.4.3.pl","-FASTQ", path ,"-Sheet", samplesheet,"-RUN", my_run_name,"-Kit", "Auto", "-Flowcell", input$flowcell,"-Workflow", xworkflow,">","/local/tNGS_TB/Rlog.txt","&"))
- Assistant
You can use the
sys.getpid()function to get the process ID of the current R session. Unfortunately, there is no direct and cross-platform way in R to get the process ID of a system call made by thesystem()function. However, you can use shell commands inside the R code to achieve this in a platform-specific manner.Here's an example for Linux/Unix systems:
R