Skip to content

Commit 2902859

Browse files
author
ripley
committed
check recursive is not a function
git-svn-id: https://svn.r-project.org/R/trunk@87802 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent fafebc1 commit 2902859

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/library/base/R/unlist.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
unlist <- function(x, recursive=TRUE, use.names=TRUE)
2020
{
2121
## for better error messages (islistfactor is not viisble)
22-
if(length(recursive) != 1L) stop("'recursive' must be of length 1")
22+
if(is.function(recursive) || length(recursive) != 1L)
23+
stop("'recursive' must be a length-1 vector")
2324
if(is.na(recursive)) stop("'recursive' is NA")
2425
if(.Internal(islistfactor(x, recursive))) {
2526
URapply <-

0 commit comments

Comments
 (0)