Skip to content

Commit a706231

Browse files
upd to sggsns
1 parent 9e6df34 commit a706231

File tree

4 files changed

+32
-16
lines changed

4 files changed

+32
-16
lines changed

.ci/linters/rd/options_doc_check.R

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
# Ensure that data.table options in code match documentation
22
check_options_documentation = function(rd_file) {
3-
if (!grepl("\\name{data.table-options}", rd_file, fixed = TRUE)) return(invisible())
3+
if (!grepl("\\name{data.table-options}", readLines(rd_file), fixed = TRUE)) return(invisible())
44

55
# Find options in R code
66
walk_r_ast_for_options = function(expr) {
7-
result = character()
87
if (is.call(expr) && length(expr) >= 2L && identical(expr[[1L]], quote(getOption)) && is.character(e2 <- expr[[2L]]) && startsWith(e2, "datatable.")) {
9-
result = e2
8+
e2
109
} else if (is.recursive(expr)) {
11-
result = c(result, unlist(lapply(expr, walk_r_ast_for_options)))
10+
unlist(lapply(expr, walk_r_ast_for_options))
1211
}
13-
result
1412
}
1513

1614
# Find options in documentation
@@ -29,8 +27,8 @@ check_options_documentation = function(rd_file) {
2927
code_opts = list.files("R", pattern = "\\.R$", full.names = TRUE) |>
3028
lapply(\(f) lapply(parse(f), walk_for_dt_options)) |>
3129
unlist() |>
32-
unique() |>
33-
setdiff("datatable.alloc")
30+
unique()
31+
3432
doc_opts = rd_file |>
3533
tools::parse_Rd() |>
3634
walk_rd() |>

.vscode/c_cpp_properties.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Win32",
5+
"includePath": [
6+
"${workspaceFolder}/**"
7+
],
8+
"defines": [
9+
"_DEBUG",
10+
"UNICODE",
11+
"_UNICODE"
12+
],
13+
"compilerPath": "C:\\MinGW\\bin\\gcc.exe",
14+
"cStandard": "c11",
15+
"cppStandard": "gnu++14",
16+
"intelliSenseMode": "windows-gcc-x86"
17+
}
18+
],
19+
"version": 4
20+
}

man/data.table-options.Rd

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,10 @@
6969
}
7070

7171
\section{Join and Subset Options}{
72-
See \code{\link{data.table}} for more related parameters and examples.
7372
\describe{
74-
\item{\code{datatable.allow.cartesian}}{A logical, default \code{FALSE}. A safety feature. If \code{FALSE}, a join
75-
is not allowed if the result would have more rows than the largest of the two tables.}
76-
\item{\code{datatable.nomatch}}{Default \code{NA}. Controls the behavior of non-matching rows in
77-
a join. Can be set to \code{0L} to drop non-matching rows.}
73+
\item{\code{datatable.allow.cartesian}}{A logical, default \code{FALSE}. Controls the default value of the
74+
allow.cartesian parameter; see \code{\link{data.table}}. If the value of this parameter is FALSE, an error is raised if
75+
a join would result in more rows than the sum of the two tables, as a safeguard against an explosive Cartesian join.}
7876
}
7977
}
8078

@@ -111,8 +109,8 @@
111109
}
112110

113111
\seealso{
114-
\code{\link{options}},
115-
\code{\link{getOption}},
112+
\code{\link[base]{options}},
113+
\code{\link[base]{getOption}},
116114
\code{\link{data.table}}
117115
}
118116

src/assign.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,10 @@ int checkOverAlloc(SEXP x)
277277
if (!isInteger(x) && !isReal(x))
278278
error(_("getOption('datatable.alloccol') should be a number, by default 1024. But its type is '%s'."), type2char(TYPEOF(x)));
279279
if (LENGTH(x) != 1)
280-
error(_("getOption('datatable.alloc') is a numeric vector ok but its length is %d. Its length should be 1."), LENGTH(x));
280+
error(_("getOption('datatable.alloccol') is a numeric vector ok but its length is %d. Its length should be 1."), LENGTH(x));
281281
int ans = asInteger(x);
282282
if (ans<0)
283-
error(_("getOption('datatable.alloc')==%d. It must be >=0 and not NA."), ans);
283+
error(_("getOption('datatable.alloccol')==%d. It must be >=0 and not NA."), ans);
284284
return ans;
285285
}
286286

0 commit comments

Comments
 (0)