Skip to content

Commit a0b7f2b

Browse files
authored
Merge branch 'master' into issue6846
2 parents 58dff19 + 5c964b3 commit a0b7f2b

34 files changed

+132
-48
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Authors@R: c(
1515
person("Tyson","Barrett", role=c("aut","cre"), email="[email protected]", comment = c(ORCID="0000-0002-2137-1391")),
1616
person("Matt","Dowle", role="aut", email="[email protected]"),
1717
person("Arun","Srinivasan", role="aut", email="[email protected]"),
18-
person("Jan","Gorecki", role="aut"),
19-
person("Michael","Chirico", role="aut", comment = c(ORCID="0000-0003-0787-087X")),
20-
person("Toby","Hocking", role="aut", comment = c(ORCID="0000-0002-3146-0865")),
18+
person("Jan","Gorecki", role="aut", email="[email protected]"),
19+
person("Michael","Chirico", role="aut", email="[email protected]", comment = c(ORCID="0000-0003-0787-087X")),
20+
person("Toby","Hocking", role="aut", email="[email protected]", comment = c(ORCID="0000-0002-3146-0865")),
2121
person("Benjamin","Schwendinger",role="aut", comment = c(ORCID="0000-0003-3315-8114")),
2222
person("Ivan", "Krylov", role="aut", email="[email protected]", comment = c(ORCID="0000-0002-0172-3812")),
2323
person("Pasha","Stetsenko", role="ctb"),

src/data.table.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#if R_VERSION < R_Version(3, 4, 0)
1818
# define SET_GROWABLE_BIT(x) // #3292
1919
#endif
20+
// TODO: remove the `R_SVN_VERSION` check when R 4.5.0 is released (circa Apr. 2025)
21+
#if R_VERSION < R_Version(4, 5, 0) || R_SVN_REVISION < 86702
22+
# define isDataFrame(x) isFrame(x) // #6180
23+
#endif
2024
#include <Rinternals.h>
2125
#define SEXPPTR_RO(x) ((const SEXP *)DATAPTR_RO(x)) // to avoid overhead of looped STRING_ELT and VECTOR_ELT
2226
#include <stdint.h> // for uint64_t rather than unsigned long long

src/dogroups.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
283283
for (int j=0; j<LENGTH(jval); ++j) {
284284
thiscol = VECTOR_ELT(jval,j);
285285
if (isNull(thiscol)) continue;
286-
if (!isVector(thiscol) || isFrame(thiscol))
286+
if (!isVector(thiscol) || isDataFrame(thiscol))
287287
error(_("Entry %d for group %d in j=list(...) should be atomic vector or list. If you are trying something like j=list(.SD,newcol=mean(colA)) then use := by group instead (much quicker), or cbind or merge afterwards."), j+1, i+1);
288288
if (isArray(thiscol)) {
289289
SEXP dims = PROTECT(getAttrib(thiscol, R_DimSymbol));

src/forder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,7 @@ void putIndex(SEXP x, SEXP cols, SEXP o) {
16161616

16171617
// isTRUE(getOption("datatable.use.index"))
16181618
bool GetUseIndex(void) {
1619-
SEXP opt = GetOption(install("datatable.use.index"), R_NilValue);
1619+
SEXP opt = GetOption1(install("datatable.use.index"));
16201620
if (!IS_TRUE_OR_FALSE(opt))
16211621
error(_("'datatable.use.index' option must be TRUE or FALSE")); // # nocov
16221622
return LOGICAL(opt)[0];
@@ -1627,7 +1627,7 @@ bool GetAutoIndex(void) {
16271627
// for now temporarily 'forder.auto.index' not 'auto.index' to disabled it by default
16281628
// because it writes attr on .SD which is re-used by all groups leading to incorrect results
16291629
// DT[, .(uN=uniqueN(.SD)), by=A]
1630-
SEXP opt = GetOption(install("datatable.forder.auto.index"), R_NilValue);
1630+
SEXP opt = GetOption1(install("datatable.forder.auto.index"));
16311631
if (isNull(opt))
16321632
return false;
16331633
if (!IS_TRUE_OR_FALSE(opt))

src/fread.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,8 +1730,10 @@ int freadMain(freadMainArgs _args) {
17301730
topQuoteRule = quoteRule;
17311731
firstJumpEnd = ch; // to know how many bytes jump 0 is, for nrow estimate later (a less-good estimate when fill=true since line lengths vary more)
17321732
if (verbose) {
1733-
DTPRINT((unsigned)sep<32 ? " sep=%#02x" : " sep='%c'", sep); // # notranslate
1734-
DTPRINT(_(" with %d fields using quote rule %d\n"), topNumFields, quoteRule);
1733+
DTPRINT((unsigned)sep<32
1734+
? _(" sep=%#02x with %d fields using quote rule %d\n")
1735+
: _(" sep='%c' with %d fields using quote rule %d\n"),
1736+
sep, topNumFields, quoteRule);
17351737
}
17361738
}
17371739
} else {
@@ -1780,8 +1782,10 @@ int freadMain(freadMainArgs _args) {
17801782
topSkip = thisRow-thisBlockLines;
17811783
if (topSkip<0) topSkip=0; // inelegant but will do for now to pass single row input such as test 890
17821784
if (verbose) {
1783-
DTPRINT((unsigned)sep<32 ? " sep=%#02x" : " sep='%c'", sep); // # notranslate
1784-
DTPRINT(_(" with %d lines of %d fields using quote rule %d\n"), topNumLines, topNumFields, topQuoteRule);
1785+
DTPRINT((unsigned)sep<32
1786+
? _(" sep=%#02x with %d lines of %d fields using quote rule %d\n")
1787+
: _(" sep='%c' with %d lines of %d fields using quote rule %d\n"),
1788+
sep, topNumLines, topNumFields, topQuoteRule);
17851789
}
17861790
}
17871791
}

src/freadR.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ SEXP freadR(
132132
args.logical01 = LOGICAL(logical01Arg)[0];
133133
args.logicalYN = LOGICAL(logicalYNArg)[0];
134134
{
135-
SEXP tt = PROTECT(GetOption(sym_old_fread_datetime_character, R_NilValue));
135+
SEXP tt = PROTECT(GetOption1(sym_old_fread_datetime_character));
136136
args.oldNoDateTime = oldNoDateTime = isLogical(tt) && LENGTH(tt)==1 && LOGICAL(tt)[0]==TRUE;
137137
UNPROTECT(1);
138138
}

src/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ inline double LLtoD(long long x) {
329329

330330
int GetVerbose(void) {
331331
// don't call repetitively; save first in that case
332-
SEXP opt = GetOption(sym_verbose, R_NilValue);
332+
SEXP opt = GetOption1(sym_verbose);
333333
if ((!isLogical(opt) && !isInteger(opt)) || LENGTH(opt)!=1 || INTEGER(opt)[0]==NA_INTEGER)
334334
error(_("verbose option must be length 1 non-NA logical or integer"));
335335
return INTEGER(opt)[0];

src/rbindlist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ SEXP rbindlist(SEXP l, SEXP usenamesArg, SEXP fillArg, SEXP idcolArg, SEXP ignor
228228
}
229229
}
230230
if (buff[0]) {
231-
SEXP opt = GetOption(install("datatable.rbindlist.check"), R_NilValue);
231+
SEXP opt = GetOption1(install("datatable.rbindlist.check"));
232232
if (!isNull(opt) && !(isString(opt) && length(opt)==1)) {
233233
warning(_("options()$datatable.rbindlist.check is set but is not a single string. See news item 5 in v1.12.2."));
234234
opt = R_NilValue;

src/subset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ SEXP subsetDT(SEXP x, SEXP rows, SEXP cols) { // API change needs update NEWS.md
296296
if (this<1 || this>LENGTH(x)) error(_("Item %d of cols is %d which is outside the range [1,ncol(x)=%d]"), i+1, this, LENGTH(x));
297297
}
298298

299-
int overAlloc = checkOverAlloc(GetOption(install("datatable.alloccol"), R_NilValue));
299+
int overAlloc = checkOverAlloc(GetOption1(install("datatable.alloccol")));
300300
SEXP ans = PROTECT(allocVector(VECSXP, LENGTH(cols)+overAlloc)); nprotect++; // doing alloc.col directly here; eventually alloc.col can be deprecated.
301301

302302
// user-defined and superclass attributes get copied as from v1.12.0

vignettes/_translation_links.R

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# build a link list of alternative languages (may be character(0))
2+
# idea is to look like 'Other languages: en | fr | de'
3+
.write.translation.links <- function(fmt) {
4+
url = "https://rdatatable.gitlab.io/data.table/articles"
5+
path = dirname(knitr::current_input(TRUE))
6+
if (basename(path) == "vignettes") {
7+
lang = "en"
8+
} else {
9+
lang = basename(path)
10+
path = dirname(path)
11+
}
12+
translation = dir(path,
13+
recursive = TRUE,
14+
pattern = glob2rx(knitr::current_input(FALSE))
15+
)
16+
transl_lang = ifelse(dirname(translation) == ".", "en", dirname(translation))
17+
block = if (!all(transl_lang == lang)) {
18+
linked_transl = sprintf("[%s](%s)", transl_lang, file.path(url, sub("(?i)\\.Rmd$", ".html", translation)))
19+
linked_transl[transl_lang == lang] = lang
20+
sprintf(fmt, paste(linked_transl, collapse = " | "))
21+
} else ""
22+
knitr::asis_output(block)
23+
}

0 commit comments

Comments
 (0)