Skip to content

Commit 81ff4f3

Browse files
Merge remote-tracking branch 'upstream/master' into fix_fwrite_length
2 parents c128e29 + 6ad0524 commit 81ff4f3

File tree

7 files changed

+47
-21
lines changed

7 files changed

+47
-21
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM docker.io/rhub/r-minimal:devel
2+
3+
RUN apk update \
4+
&& apk add --no-cache \
5+
gcc git musl-dev openmp pkgconf tzdata zlib-dev \
6+
&& echo 'options("repos"="https://cloud.r-project.org")' >> /usr/local/lib/R/etc/Rprofile.site
7+
8+
ENV TZDIR=/usr/share/zoneinfo
9+
10+
COPY DESCRIPTION .
11+
12+
RUN Rscript -e ' \
13+
read.dcf("DESCRIPTION", c("Imports", "Suggests")) |> \
14+
tools:::.split_dependencies() |> \
15+
names() |> \
16+
setdiff(tools:::.get_standard_package_names()$base) |> \
17+
install.packages(repos="https://cloud.r-project.org") \
18+
'
19+
20+
# setup cc()
21+
WORKDIR /root
22+
COPY .devcontainer/.Rprofile .
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"build": { "dockerfile": "Dockerfile", "context": "../.." },
3+
"customizations": { "vscode": {
4+
"extensions": [
5+
"REditorSupport.r",
6+
"ms-vscode.cpptools-extension-pack"
7+
]
8+
}}
9+
}

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ rowwiseDT(
125125

126126
15. Joins of `integer64` and `double` columns succeed when the `double` column has lossless `integer64` representation, [#4167](https://github.com/Rdatatable/data.table/issues/4167) and [#6625](https://github.com/Rdatatable/data.table/issues/6625). Previously, this only worked when the double column had lossless _32-bit_ integer representation. Thanks @MichaelChirico for the reports and fix.
127127

128-
17. `DT[order(...)]` better matches `base::order()` behavior by (1) recognizing the `method=` argument (and erroring since this is not supported) and (2) accepting a vector of `TRUE`/`FALSE` in `decreasing=` as an alternative to using `-a` to convey "sort `a` decreasing", [#4456](https://github.com/Rdatatable/data.table/issues/4456). Thanks @jangorecki for the FR and @MichaelChirico for the PR.
128+
16. `DT[order(...)]` better matches `base::order()` behavior by (1) recognizing the `method=` argument (and erroring since this is not supported) and (2) accepting a vector of `TRUE`/`FALSE` in `decreasing=` as an alternative to using `-a` to convey "sort `a` decreasing", [#4456](https://github.com/Rdatatable/data.table/issues/4456). Thanks @jangorecki for the FR and @MichaelChirico for the PR.
129129

130130
17. Assignment with `:=` to an S4 slot of an under-allocated data.table now works, [#6704](https://github.com/Rdatatable/data.table/issues/6704). Thanks @MichaelChirico for the report and fix.
131131

@@ -153,6 +153,8 @@ rowwiseDT(
153153
154154
11. Deprecation of `fread(autostart=)` has been upgraded to an error. It has been warning since v1.11.0 (6 years ago). The argument will be removed in the next release.
155155
156+
12. Deprecation of `droplevels(in.place=TRUE)` (warning since v1.16.0) has been upgraded from warning to error. The argument will be removed in the next release.
157+
156158
# data.table [v1.16.4](https://github.com/Rdatatable/data.table/milestone/36) 4 December 2024
157159
158160
## BUG FIXES

R/fdroplevels.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ fdroplevels = function(x, exclude = if (anyNA(levels(x))) NULL else NA, ...) {
88
return(ans)
99
}
1010

11-
droplevels.data.table = function(x, except=NULL, exclude, in.place=FALSE, ...){
12-
stopifnot(is.logical(in.place))
13-
if (isTRUE(in.place)) warningf("droplevels() with in.place=TRUE is deprecated. Use setdroplevels() instead.")
14-
if (!in.place) x = copy(x)
11+
droplevels.data.table = function(x, except=NULL, exclude, in.place=NULL, ...){
12+
if (!is.null(in.place)) stopf("droplevels() with in.place=TRUE is deprecated. Use setdroplevels() instead.")
13+
x = copy(x)
1514
if (missing(exclude)) exclude = NULL
1615
setdroplevels(x, except, exclude)[]
1716
}

configure

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,11 @@ else
3434
NOZLIB=0
3535
lib=`pkg-config --libs zlib`
3636
cflag=`pkg-config --cflags zlib`
37-
expr -- "$lib" : ".*-lz$" >> config.log # -- for FreeBSD, #4652
37+
echo "$lib" | grep -qE '[-]lz($| )' >> config.log
3838
if [ $? -ne 0 ]; then
39-
expr -- "$lib" : ".*-lz " >> config.log
40-
# would use \b in one expr but MacOS does not support \b
41-
if [ $? -ne 0 ]; then
42-
echo "*** pkg-config is installed and 'pkg-config --exists zlib' succeeds but"
43-
echo "*** 'pkg-config --libs zlib' returns '${lib}' which does not include the standard -lz."
44-
msg=1
45-
fi
39+
echo "*** pkg-config is installed and 'pkg-config --exists zlib' succeeds but"
40+
echo "*** 'pkg-config --libs zlib' returns '${lib}' which does not include the standard -lz."
41+
msg=1
4642
fi
4743
fi
4844
fi

inst/tests/tests.Rraw

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8449,11 +8449,9 @@ baseR = base::order(c(x2,x1,x1,x2))
84498449
# are so relaxed now that they barely testing anything. It appears base R behaviour is undefined in this rare case of identical strings in different encodings.
84508450
test(1590.04, identical(baseR, INT(1,4,2,3)) || identical(baseR, INT(2,3,1,4)) || identical(baseR, 1:4))
84518451
Encoding(x2) = "unknown"
8452-
# TODO(#6350): Decide if this test should be adjusted for Alpine Linux, or just dropped.
8453-
if (!file.exists("/etc/alpine-release")) {
8454-
test(1590.05, x1!=x2)
8455-
test(1590.06, forderv( c(x2,x1,x1,x2)), INT(1,4,2,3)) # consistent with Windows-1252 result, tested further below
8456-
}
8452+
# test(1590.05, x1!=x2) # Skip this test of R's own behavior since R itself does not give platform-consistent results, #6350
8453+
# TODO(#6350): Restore this test. On Alpine, forder() finds this input to be sorted, but we want to be platform-independent.
8454+
if (!file.exists("/etc/alpine-release")) test(1590.06, forderv( c(x2,x1,x1,x2)), INT(1,4,2,3)) # consistent with Windows-1252 result, tested further below
84578455
baseR = base::order(c(x2,x1,x1,x2))
84588456
test(1590.07, identical(baseR, INT(1,4,2,3)) || identical(baseR, INT(2,3,1,4)) || identical(baseR, 1:4))
84598457
Sys.setlocale("LC_CTYPE", ctype)
@@ -17794,7 +17792,7 @@ if (base::getRversion() >= "3.4.0") {
1779417792
}
1779517793
test(2214.06, droplevels(DT)[["a"]], droplevels(DT[1:5,a]))
1779617794
test(2214.07, droplevels(DT, 1)[["a"]], x[1:5])
17797-
test(2214.08, droplevels(DT, in.place=TRUE), DT, warning="droplevels() with in.place=TRUE is deprecated.")
17795+
test(2214.08, droplevels(DT, in.place=TRUE), error="droplevels() with in.place=TRUE is deprecated.")
1779817796
# support ordered factors in fdroplevels
1779917797
o = factor(letters[1:10], ordered=TRUE)
1780017798
test(2214.09, fdroplevels(o[1:5]), droplevels(o[1:5]))

man/fdroplevels.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
fdroplevels(x, exclude = if (anyNA(levels(x))) NULL else NA, \dots)
1313
setdroplevels(x, except = NULL, exclude = NULL)
1414

15-
\method{droplevels}{data.table}(x, except = NULL, exclude, in.place = FALSE, \dots)
15+
\method{droplevels}{data.table}(x, except = NULL, exclude, in.place = NULL, \dots)
1616
}
1717
\arguments{
1818
\item{x}{ \code{factor} or \code{data.table} where unused levels should be dropped. }
1919
\item{exclude}{ A \code{character} vector of factor levels which are dropped no matter of presented or not. }
2020
\item{except}{ An \code{integer} vector of indices of data.table columns which are not modified by dropping levels. }
21-
\item{in.place}{ logical (default is \code{FALSE}). If \code{TRUE} levels of factors of \code{data.table} are modified in-place. }
21+
\item{in.place}{ Deprecated. Use \code{setdroplevels} for in-place modification. }
2222
\item{\dots}{ further arguments passed to methods }
2323
}
2424

0 commit comments

Comments
 (0)