Skip to content

Commit 61fbe24

Browse files
committed
add escape for datatable unaware for package
1 parent cde7333 commit 61fbe24

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,8 @@
560560

561561
55. `fread(URL)` with `https:` and `ftps:` could timeout if proxy settings were not guessed right by `curl::curl_download`, [#1686](https://github.com/Rdatatable/data.table/issues/1686). `fread(URL)` now uses `download.file()` as default for downloading files from urls. Thanks to @cderv for the report and Benjamin Schwendinger for the fix.
562562

563+
56. `dim.data.table` returns now the same `dim.data.frame` in `data.table`-unaware environments, [#](). Thanks to @akersting for reporting and Benjamin Schwendinger for the fix.
564+
563565
## NOTES
564566

565567
1. New feature 29 in v1.12.4 (Oct 2019) introduced zero-copy coercion. Our thinking is that requiring you to get the type right in the case of `0` (type double) vs `0L` (type integer) is too inconvenient for you the user. So such coercions happen in `data.table` automatically without warning. Thanks to zero-copy coercion there is no speed penalty, even when calling `set()` many times in a loop, so there's no speed penalty to warn you about either. However, we believe that assigning a character value such as `"2"` into an integer column is more likely to be a user mistake that you would like to be warned about. The type difference (character vs integer) may be the only clue that you have selected the wrong column, or typed the wrong variable to be assigned to that column. For this reason we view character to numeric-like coercion differently and will warn about it. If it is correct, then the warning is intended to nudge you to wrap the RHS with `as.<type>()` so that it is clear to readers of your code that a coercion from character to that type is intended. For example :

R/data.table.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ if (!exists("trimws", "package:base")) {
88

99
dim.data.table = function(x)
1010
{
11+
if (!cedta()) return(NextMethod())
1112
.Call(Cdim, x)
1213
}
1314

0 commit comments

Comments
 (0)