Skip to content

Commit 912d0cd

Browse files
committed
indentation correction
1 parent e849fe6 commit 912d0cd

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

R/merge.R

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,34 @@ merge.data.table = function(x, y, by = NULL, by.x = NULL, by.y = NULL, all = FAL
2222
warningf("Input data.table '%s' has no columns.", "y")
2323
}
2424
}
25-
check_duplicate_names(x)
26-
check_duplicate_names(y)
25+
check_duplicate_names(x)
26+
check_duplicate_names(y)
2727

28-
nm_x = names(x)
29-
nm_y = names(y)
28+
nm_x = names(x)
29+
nm_y = names(y)
3030

3131
## set up 'by'/'by.x'/'by.y'
32-
if ( (!is.null(by.x) || !is.null(by.y)) && length(by.x)!=length(by.y) )
32+
if ((!is.null(by.x) || !is.null(by.y)) && length(by.x) != length(by.y))
3333
stopf("'by.x' and 'by.y' must be of same length.")
3434
if (!missing(by) && !missing(by.x))
3535
warningf("Supplied both by and 'by.x/by.y.' by argument will be ignored.")
3636
if (!is.null(by.x)) {
37-
if (length(by.x)==0L || !is.character(by.x) || !is.character(by.y))
37+
if (length(by.x) == 0L || !is.character(by.x) || !is.character(by.y))
3838
stopf("A non-empty vector of column names is required for 'by.x' and 'by.y'.")
3939
if (!all(by.x %chin% nm_x)) {
40-
missing_in_x <- setdiff(by.x, nm_x)
41-
stopf("The following columns listed in 'by.x' are missing from x: %s", brackify(missing_in_x))
42-
}
43-
if (!all(by.y %chin% nm_y)) {
44-
missing_in_y <- setdiff(by.y, nm_y)
45-
stopf("The following columns listed in 'by.y' are missing from y: %s", brackify(missing_in_y))
46-
}
47-
by = by.x
48-
names(by) = by.y
40+
missing_in_x <- setdiff(by.x, nm_x)
41+
stopf("The following columns listed in 'by.x' are missing from x: %s", brackify(missing_in_x))
42+
}
43+
if (!all(by.y %chin% nm_y)) {
44+
missing_in_y <- setdiff(by.y, nm_y)
45+
stopf("The following columns listed in 'by.y' are missing from y: %s", brackify(missing_in_y))
46+
}
47+
by = by.x
48+
names(by) = by.y
4949
} else {
5050
if (is.null(by))
5151
by = intersect(key(x), key(y))
52-
if (!length(by)) # was is.null() before PR#5183 changed to !length()
52+
if (!length(by)) # was is.null() before PR#5183 changed to !length()
5353
by = key(x)
5454
if (!length(by))
5555
by = intersect(nm_x, nm_y)
@@ -59,12 +59,12 @@ names(by) = by.y
5959
missing_in_y <- setdiff(by, nm_y)
6060
if (length(missing_in_x) > 0 || length(missing_in_y) > 0) {
6161
stopf(gettextf("The following columns are missing:\n%s%s",
62-
if (length(missing_in_x) > 0) gettextf(" - From x: %s\n", brackify(missing_in_x)) else "",
63-
if (length(missing_in_y) > 0) gettextf(" - From y: %s\n", brackify(missing_in_y)) else ""))
62+
if (length(missing_in_x) > 0) gettextf(" - From x: %s\n", brackify(missing_in_x)) else "",
63+
if (length(missing_in_y) > 0) gettextf(" - From y: %s\n", brackify(missing_in_y)) else ""))
6464
}
6565
by = unname(by)
6666
by.x = by.y = by
67-
}
67+
}
6868
# warn about unused arguments #2587
6969
if (length(list(...))) {
7070
ell = as.list(substitute(list(...)))[-1L]

0 commit comments

Comments
 (0)