Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/data.table.R
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ replace_dot_alias = function(e) {
if (!typeof(byval[[jj]]) %chin% ORDERING_TYPES) stop("column or expression ",jj," of 'by' or 'keyby' is type ",typeof(byval[[jj]]),". Do not quote column names. Usage: DT[,sum(colC),by=list(colA,month(colB))]")
}
tt = vapply_1i(byval,length)
if (any(tt!=xnrow)) stop("The items in the 'by' or 'keyby' list are length (",paste(tt,collapse=","),"). Each must be length ", xnrow, "; the same length as there are rows in x (after subsetting if i is provided).")
if (any(tt!=xnrow)) stop(gettextf("The items in the 'by' or 'keyby' list are length(s) (%s). Each must be length %d; the same length as there are rows in x (after subsetting if i is provided).", paste(tt, collapse=","), xnrow, domain='R-data.table'))
if (is.null(bynames)) bynames = rep.int("",length(byval))
if (length(idx <- which(!nzchar(bynames))) && !bynull) {
# TODO: improve this and unify auto-naming of jsub and bysub
Expand Down Expand Up @@ -874,7 +874,7 @@ replace_dot_alias = function(e) {
# attempt to auto-name unnamed columns
for (jj in which(nm=="")) {
thisq = q[[jj + 1L]]
if (missing(thisq)) stop("Item ", jj, " of the .() or list() passed to j is missing") #3507
if (missing(thisq)) stop(gettextf("Item %d of the .() or list() passed to j is missing", jj, domain="R-data.table")) #3507
if (is.name(thisq)) nm[jj] = drop_dot(thisq)
# TO DO: if call to a[1] for example, then call it 'a' too
}
Expand Down
2 changes: 1 addition & 1 deletion R/devel.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dcf.repo = function(pkg, repo, field, type){
idx = file(file.path(contrib.url(repo, type=type),"PACKAGES"))
on.exit(close(idx))
dcf = read.dcf(idx, fields=c("Package",field))
if (!pkg %in% dcf[,"Package"]) stop("There is no ", pkg, " package in provided repository.")
if (!pkg %in% dcf[,"Package"]) stop(gettextf("There is no package %s in provided repository.", pkg, domain='R-data.table'))
dcf[dcf[,"Package"]==pkg, field][[1L]]
}

Expand Down
4 changes: 2 additions & 2 deletions R/last.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ last = function(x, n=1L, ...) {
}
} else {
if (!requireNamespace("xts", quietly=TRUE))
stop("'xts' class passed to data.table::last function but 'xts' is not available, you should have 'xts' installed already") # nocov
stop(gettextf("'xts' class passed to %s function but 'xts' is not available, you should have 'xts' installed already", "data.table::last", domain="R-data.table")) # nocov
if (verbose)
cat("last: using xts::last: is.xts(x)\n")
xts::last(x, n=n, ...)
Expand Down Expand Up @@ -76,7 +76,7 @@ first = function(x, n=1L, ...) {
}
} else {
if (!requireNamespace("xts", quietly=TRUE))
stop("'xts' class passed to data.table::first function but 'xts' is not available, you should have 'xts' installed already") # nocov
stop(gettextf("'xts' class passed to %s function but 'xts' is not available, you should have 'xts' installed already", "data.table::first", domain="R-data.table")) # nocov
if (verbose)
cat("first: using xts::first: is.xts(x)\n")
xts::first(x, n=n, ...)
Expand Down
4 changes: 2 additions & 2 deletions R/setkey.R
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ setorder = function(x, ..., na.last=FALSE)
# na.last=FALSE here, to be consistent with data.table's default
# as opposed to DT[order(.)] where na.last=TRUE, to be consistent with base
{
if (!is.data.frame(x)) stop("x must be a data.frame or data.table.")
if (!is.data.frame(x)) stop("x must be a data.frame or data.table")
cols = substitute(list(...))[-1L]
if (identical(as.character(cols),"NULL")) return(x)
if (length(cols)) {
Expand Down Expand Up @@ -357,7 +357,7 @@ CJ = function(..., sorted = TRUE, unique = FALSE)
}
}
nrow = prod( vapply_1i(l, length) ) # lengths(l) will work from R 3.2.0
if (nrow > .Machine$integer.max) stop("Cross product of elements provided to CJ() would result in ",nrow," rows which exceeds .Machine$integer.max == ",.Machine$integer.max)
if (nrow > .Machine$integer.max) stop(gettextf("Cross product of elements provided to CJ() would result in %d rows which exceeds .Machine$integer.max == %d", nrow, Machine$integer.max, domain='R-data.table'))
l = .Call(Ccj, l)
setDT(l)
l = setalloccol(l) # a tiny bit wasteful to over-allocate a fixed join table (column slots only), doing it anyway for consistency since
Expand Down
2 changes: 1 addition & 1 deletion R/test.data.table.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test.data.table = function(script="tests.Rraw", verbose=FALSE, pkg=".", silent=F
# nocov start
fn2 = paste0(fn,".bz2")
if (!file.exists(file.path(fulldir, fn2)))
stop("Neither ",fn," or ",fn2," exist in ",fulldir)
stop(gettextf("Neither %s nor %s exist in %s",fn, fn2, fulldir, domain="R-data.table"))
fn = fn2
# nocov end
# sys.source() below accepts .bz2 directly.
Expand Down
Binary file modified inst/po/en@quot/LC_MESSAGES/R-data.table.mo
Binary file not shown.
Binary file modified inst/po/en@quot/LC_MESSAGES/data.table.mo
Binary file not shown.
Binary file modified inst/po/zh_CN/LC_MESSAGES/R-data.table.mo
Binary file not shown.
Binary file modified inst/po/zh_CN/LC_MESSAGES/data.table.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -13889,7 +13889,7 @@ test(1984.05, DT[ , sum(b), keyby = c, verbose = TRUE],
test(1984.06, DT[1:3, sum(a), by=b:c], data.table(b=10:8, c=1:3, V1=1:3))
test(1984.07, DT[, sum(a), by=call('sin',pi)], error='must evaluate to a vector or a list of vectors')
test(1984.08, DT[, sum(a), by=as.raw(0)], error='column or expression.*type raw')
test(1984.09, DT[, sum(a), by=.(1,1:2)], error='The items.*list are length [(]1,2[)].*Each must be length 10; .*rows in x.*after subsetting')
test(1984.09, DT[, sum(a), by=.(1,1:2)], error='The items.*list are length[(]s[)] [(]1,2[)].*Each must be length 10; .*rows in x.*after subsetting')
options('datatable.optimize' = Inf)
test(1984.10, DT[ , 1, by = .(a %% 2), verbose = TRUE],
data.table(a = c(1, 0), V1 = c(1, 1)),
Expand Down
35 changes: 7 additions & 28 deletions po/R-data.table.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: data.table 1.12.9\n"
"POT-Creation-Date: 2019-12-22 23:59\n"
"POT-Creation-Date: 2019-12-29 22:35\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -403,13 +403,7 @@ msgstr ""
msgid ". Do not quote column names. Usage: DT[,sum(colC),by=list(colA,month(colB))]"
msgstr ""

msgid "The items in the 'by' or 'keyby' list are length ("
msgstr ""

msgid "). Each must be length"
msgstr ""

msgid "; the same length as there are rows in x (after subsetting if i is provided)."
msgid "The items in the 'by' or 'keyby' list are length(s) (%s). Each must be length %d; the same length as there are rows in x (after subsetting if i is provided)."
msgstr ""

msgid "Internal error: drop_dot passed"
Expand All @@ -418,7 +412,7 @@ msgstr ""
msgid "items"
msgstr ""

msgid "of the .() or list() passed to j is missing"
msgid "Item %d of the .() or list() passed to j is missing"
msgstr ""

msgid "Different branches of j expression produced different auto-named columns:"
Expand Down Expand Up @@ -853,10 +847,7 @@ msgstr ""
msgid "."
msgstr ""

msgid "There is no"
msgstr ""

msgid "package in provided repository."
msgid "There is no package %s in provided repository."
msgstr ""

msgid "'fromLast' must be TRUE or FALSE"
Expand Down Expand Up @@ -1324,10 +1315,7 @@ msgstr ""
msgid "Using integer64 class columns require to have 'bit64' package installed."
msgstr ""

msgid "'xts' class passed to data.table::last function but 'xts' is not available, you should have 'xts' installed already"
msgstr ""

msgid "'xts' class passed to data.table::first function but 'xts' is not available, you should have 'xts' installed already"
msgid "'xts' class passed to %s function but 'xts' is not available, you should have 'xts' installed already"
msgstr ""

msgid "Argument 'sort' should be logical TRUE/FALSE"
Expand Down Expand Up @@ -1549,9 +1537,6 @@ msgstr ""
msgid "New parallel sort has not been implemented for vectors containing NA values so far. Using one thread."
msgstr ""

msgid "x must be a data.frame or data.table."
msgstr ""

msgid "x must be a data.frame or data.table"
msgstr ""

Expand All @@ -1573,10 +1558,7 @@ msgstr ""
msgid "is non-atomic, which can't be sorted; try setting sorted = FALSE"
msgstr ""

msgid "Cross product of elements provided to CJ() would result in"
msgstr ""

msgid "rows which exceeds .Machine$integer.max =="
msgid "Cross product of elements provided to CJ() would result in %d rows which exceeds .Machine$integer.max == %d"
msgstr ""

msgid "x and y must both be data.tables"
Expand Down Expand Up @@ -1669,10 +1651,7 @@ msgstr ""
msgid "script must end with '.Rraw'. If a file ending '.Rraw.bz2' exists, that will be found and used."
msgstr ""

msgid "Neither"
msgstr ""

msgid "exist in"
msgid "Neither %s nor %s exist in %s"
msgstr ""

msgid "Failed after test"
Expand Down
Loading