Skip to content

Commit 46dbcdd

Browse files
use 'try' for known error in example
1 parent 2e228a4 commit 46dbcdd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

man/mergelist.Rd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747

4848
When the \code{on} argument is missing, it will be determined based \code{how} argument:
4949
\enumerate{
50-
\item{ When \code{how \%in\% c("left", right", "semi", "anti")}, \code{on} becomes the key columns of the \emph{join-to} table. }
51-
\item{ When \code{how \%in\% c("inner", full")}, if only one table has key, then this key is used; if both tables have keys, then \code{on = intersect(key(lhs), key(rhs))}, having its order aligned to shorter key. }
50+
\item{ When \code{how \%in\% c("left", right", "semi", "anti")}, \code{on} becomes the key column(s) of the \emph{join-to} table. }
51+
\item{ When \code{how \%in\% c("inner", full")}, if only one table has a key, then this key is used; if both tables have keys, then \code{on = intersect(key(lhs), key(rhs))}, having its order aligned to shorter key. }
5252
}
5353

5454
When joining tables that are not directly linked to a single table, e.g. a snowflake schema, a \emph{right} outer join can be used to optimize the sequence of merges, see Examples.
@@ -106,8 +106,8 @@ l = list(
106106
data.table(id1=c(2:3, 2L), v2=1:3), ## dups in RHS
107107
data.table(id1=3:5, v3=1:3)
108108
)
109-
#mergelist(l, on="id1") # ERROR: mult='error' and multiple matches during merge
110109
lapply(l[-1L], `[`, j = if (.N>1L) .SD, by = "id1") ## duplicated rows
110+
try(mergelist(l, on="id1"))
111111

112112
## 'star schema' and 'snowflake schema' examples
113113

0 commit comments

Comments
 (0)