I am a beginner in R. I want to be able to interrupt the currently running script if a condition is true. The closest thing I have found is the ps_kill
function, which crashes Rstudio.
df <- data.frame(one = c(1,2,NA,4,NA), two = c(NA,NA,8,NA,10))
if (sum(is.na(df)) > 3)
{
ps_kill(p = ps_handle())
}
Is there a function I could use to replace ps_kill
, to interrupt the script without crashing Rstudio ?