Skip to content

Commit b2cd771

Browse files
author
ripley
committed
pretest for more interpretable error messages
git-svn-id: https://svn.r-project.org/R/trunk@87786 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 0dc1efc commit b2cd771

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/library/base/R/unlist.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File src/library/base/R/unlist.R
22
# Part of the R package, https://www.R-project.org
33
#
4-
# Copyright (C) 1995-2018 The R Core Team
4+
# Copyright (C) 1995-2025 The R Core Team
55
#
66
# This program is free software; you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -18,6 +18,8 @@
1818

1919
unlist <- function(x, recursive=TRUE, use.names=TRUE)
2020
{
21+
## for better error messages (islistfactor is not viisble)
22+
if(length(recursive) > 1L) stop("'recursive' must be of length 1")
2123
if(.Internal(islistfactor(x, recursive))) {
2224
URapply <-
2325
if(recursive) # use rapply()

0 commit comments

Comments
 (0)