Skip to content

Commit 4e2a402

Browse files
author
ripley
committed
up
git-svn-id: https://svn.r-project.org/R/trunk@87824 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 9d33c66 commit 4e2a402

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/coerce.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,7 @@ int asLogical(SEXP x)
18241824
return asLogical2(x, /* checking = */ 0, R_NilValue);
18251825
}
18261826

1827+
// private version
18271828
Rboolean asRbool(SEXP x, SEXP call)
18281829
{
18291830
int ans = asLogical2(x, 1, call);
@@ -1832,6 +1833,15 @@ Rboolean asRbool(SEXP x, SEXP call)
18321833
return (Rboolean) ans;
18331834
}
18341835

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+
18351845

18361846
int asInteger(SEXP x)
18371847
{

0 commit comments

Comments
 (0)