Skip to content

Commit a36caac

Browse files
authored
bmerge coercion support old R (#6635)
* do not use .Date which was introduced in R 3.5 * add TODOs * clean git hickup * add more todos * remove wrong todo
1 parent 541f27e commit a36caac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

inst/tests/tests.Rraw

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15031,7 +15031,7 @@ test(2042.3, DT[ , format(mean(date),"%b-%Y"), by=g, verbose=TRUE ], # just thi
1503115031
# also incidentally fixed #2491
1503215032
DT = data.table(
1503315033
Group = c("A", "A", "B", "B", "C", "C"),
15034-
Date1 = `class<-`(c(17446.0291040738, 17470.0221205444, 17445.0765226481, # `class<-`() == .Date() to pass on R 3.1.0
15034+
Date1 = `class<-`(c(17446.0291040738, 17470.0221205444, 17445.0765226481, # `class<-`() == .Date() to pass on R 3.1.0 # TODO: update to .Date on R 3.5
1503515035
17456.0360002079, 17440.0230725919, 17451.0572453837), "Date"),
1503615036
Date2 = `class<-`(c(17459.1561177987, 17451.1086757995, 17449.0820898537,
1503715037
17443.1175238448, 17461.0463715783, 17448.1033968224), "Date")
@@ -20620,8 +20620,8 @@ y = data.table(c=1, d=1L)
2062020620
test(2297.03, y[x, on=.(c == a, d == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a .*no fractions.* to type integer.*Coercing .*c .*no fractions.* to type integer")
2062120621
test(2297.04, y[x, on=.(d == a, c == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a .*no fractions.* to type integer.*Coercing .*c .*no fractions.* to type integer")
2062220622
# dates
20623-
d_int = .Date(1L)
20624-
d_dbl = .Date(1)
20623+
d_int = `class<-`(1L, "Date") # TODO: update to .Date on R 3.5
20624+
d_dbl = `class<-`(1, "Date")
2062520625
x = data.table(a=d_int)
2062620626
y = data.table(c=d_int, d=d_dbl)
2062720627
test(2297.11, y[x, on=.(c == a, d == a)], data.table(c=d_int, d=d_int))

0 commit comments

Comments
 (0)