Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87824 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Feb 25, 2025
1 parent 9d33c66 commit 4e2a402
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/coerce.c
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,7 @@ int asLogical(SEXP x)
return asLogical2(x, /* checking = */ 0, R_NilValue);
}

// private version
Rboolean asRbool(SEXP x, SEXP call)
{
int ans = asLogical2(x, 1, call);
Expand All @@ -1832,6 +1833,15 @@ Rboolean asRbool(SEXP x, SEXP call)
return (Rboolean) ans;
}

// public version
Rboolean asRboolean(SEXP x)
{
int ans = asLogical2(x, 1, R_NilValue);
if (ans == NA_LOGICAL)
error(_("NA in coercion to Rboolean"));
return (Rboolean) ans;
}


int asInteger(SEXP x)
{
Expand Down

0 comments on commit 4e2a402

Please sign in to comment.