我正在寻找linux/POSIX exit(n)的R类似功能,它将使用退出代码n停止进程,并向父进程发出发生错误的信号.R有这样的设施吗?

推荐答案

这是对quit()的辩论.见?quit.

Arguments:

status: the (numerical) error status to be returned to the operating
        system, where relevant.  Conventionally ‘0’ indicates
        successful completion.

Details:

 Some error statuses are used by R itself.  The default error
 handler for non-interactive use effectively calls ‘q("no", 1,
 FALSE)’ and returns error code 1.  Error status 2 is used for R
 ‘suicide’, that is a catastrophic failure, and other small numbers
 are used by specific ports for initialization failures.  It is
 recommended that users choose statuses of 10 or more.

R相关问答推荐

使用case_when和Mutate搜索多个列以寻找条件

工作流程_set带有Dplyrr风格的 Select 器,用于 Select 结果和预测因子R

如何对数据集进行逆向工程?

如何自定义Shapviz图?

使用R中相同值创建分组观测指标

如果行和大于值,则过滤

更改默认系列1以更改名称

如何直接从Fortran到R的数组大小?

自动变更列表

错误:非常长的R行中出现意外符号

将重复项转换为NA

用R ggplot2求上、下三角形中两个变量的矩阵热图

在保留列表元素属性的同时替换列表元素

派生程序包| ;无法检索';return()';的正文

自定义gggraph,使geom_abline图层仅在沿x轴的特定范围内显示

如何创建累加到现有列累计和的新列?

我如何使用循环来编写冗余的Rmarkdown脚本?

R中时间间隔的大向量与参考时间间隔的相交

从线的交点创建面

如何在R中创建这些列?