Skip to content

Commit 394f90b

Browse files
Explain 'NULL' in cols= in Rd
1 parent 4b58a7a commit 394f90b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

R/mergelist.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ mergelist_impl_ = function(l, on, cols, how, mult, copy) {
305305
if (!is.list(cols))
306306
stopf("'%s' must be a list", "cols")
307307
if (length(cols) != n)
308-
stopf("'cols' must be same length as 'l'")
308+
stopf("'cols' must be same length as 'l' (%d != %d)", length(cols), n)
309309
skip = vapply_1b(cols, is.null)
310310
if (!all(vapply_1b(cols[!skip], function(x) is.character(x) && !anyNA(x) && !anyDuplicated(x))))
311311
stopf("'cols' must be a list of non-zero length, non-NA, non-duplicated, character vectors, or eventually NULLs (all columns)")

man/mergelist.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
\arguments{
1717
\item{l}{ \code{list} of \code{data.table}s to merge. }
1818
\item{on}{ \code{character} vector of column names to merge on; when missing, the \code{\link{key}} of the \emph{join-to} table is used (see Details). }
19-
\item{cols}{ Optional \code{list} of \code{character} column names corresponding to tables in \code{l}, used to subset columns during merges. }
19+
\item{cols}{ Optional \code{list} of \code{character} column names corresponding to tables in \code{l}, used to subset columns during merges. \code{NULL} means all columns, all tables; \code{NULL} entries in a list means all columns for the corresponding table. }
2020
\item{how}{ \code{character} scalar, controls how to merge tables. Allowed values are \code{"left"} (default), \code{"inner"}, \code{"full"}, \code{"right"}, \code{"semi"}, \code{"anti"}, \code{"cross"}. See Details. }
2121
\item{mult}{ \code{character} scalar, controls how to proceed when multiple rows in \emph{join-to} table match to the row in \emph{join-from} table. Allowed values are \code{"error"}, \code{"all"}, \code{"first"}, \code{"last"}. Default depends on \code{how}, described in \emph{details} below. See examples on how to detect duplicated matches. Using \code{"all"} is recommended together with \code{join.many=FALSE}, unless rows explosion or cartesian product are intended. }
2222
\item{join.many}{ \code{logical}, defaults to \code{getOption("datatable.join.many")}, which is \code{TRUE} by default; when \code{FALSE} and \code{mult="all"}, then extra check is made to ensure no \emph{many-to-many} matches exist between tables, and if they exist, then exception is raised. Works similarly to \code{allow.cartesian} option in \code{[.data.table} but is more strict. An option \code{"datatable.join.many"} controls that globally for \code{mergelist} and \code{[.data.table}. }

0 commit comments

Comments
 (0)