We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d33c66 commit 4e2a402Copy full SHA for 4e2a402
src/main/coerce.c
@@ -1824,6 +1824,7 @@ int asLogical(SEXP x)
1824
return asLogical2(x, /* checking = */ 0, R_NilValue);
1825
}
1826
1827
+// private version
1828
Rboolean asRbool(SEXP x, SEXP call)
1829
{
1830
int ans = asLogical2(x, 1, call);
@@ -1832,6 +1833,15 @@ Rboolean asRbool(SEXP x, SEXP call)
1832
1833
return (Rboolean) ans;
1834
1835
1836
+// public version
1837
+Rboolean asRboolean(SEXP x)
1838
+{
1839
+ int ans = asLogical2(x, 1, R_NilValue);
1840
+ if (ans == NA_LOGICAL)
1841
+ error(_("NA in coercion to Rboolean"));
1842
+ return (Rboolean) ans;
1843
+}
1844
+
1845
1846
int asInteger(SEXP x)
1847
0 commit comments