|
73 | 73 | # In fread and fwrite we have moved back to using getOption's default argument since it is unlikely fread and fread will be called in a loop many times, plus they |
74 | 74 | # are relatively heavy functions where the overhead in getOption() would not be noticed. It's only really [.data.table where getOption default bit. |
75 | 75 | # Improvement to base::getOption() now submitted (100x; 5s down to 0.05s): https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17394 |
76 | | - opts = c( |
77 | | - "datatable.verbose"="FALSE", # datatable.<argument name> |
78 | | - "datatable.optimize"="Inf", # datatable.<argument name> |
79 | | - "datatable.print.nrows"="100L", # datatable.<argument name> |
80 | | - "datatable.print.topn"="5L", # datatable.<argument name> |
81 | | - "datatable.print.class"="TRUE", # for print.data.table |
82 | | - "datatable.print.rownames"="TRUE", # for print.data.table |
83 | | - "datatable.print.colnames"="'auto'", # for print.data.table |
84 | | - "datatable.print.keys"="TRUE", # for print.data.table |
85 | | - "datatable.print.trunc.cols"="FALSE", # for print.data.table |
86 | | - "datatable.show.indices"="FALSE", # for print.data.table |
87 | | - "datatable.allow.cartesian"="FALSE", # datatable.<argument name> |
88 | | - "datatable.join.many"="TRUE", # mergelist, [.data.table #4383 #914 |
89 | | - "datatable.dfdispatchwarn"="TRUE", # not a function argument |
90 | | - "datatable.warnredundantby"="TRUE", # not a function argument |
91 | | - "datatable.alloccol"="1024L", # argument 'n' of alloc.col. Over-allocate 1024 spare column slots |
92 | | - "datatable.auto.index"="TRUE", # DT[col=="val"] to auto add index so 2nd time faster |
93 | | - "datatable.use.index"="TRUE", # global switch to address #1422 |
94 | | - "datatable.prettyprint.char" = NULL, # FR #1091 |
95 | | - "datatable.old.matrix.autoname"="TRUE", # #7145: how data.table(x=1, matrix(1)) is auto-named set to change |
96 | | - NULL |
97 | | - ) |
98 | | - for (i in setdiff(names(opts),names(options()))) { |
99 | | - eval(parse(text=paste0("options(",i,"=",opts[i],")"))) |
100 | | - } |
| 76 | + opts = list( |
| 77 | + datatable.verbose=FALSE, # datatable.<argument name> |
| 78 | + datatable.optimize=Inf, # datatable.<argument name> |
| 79 | + datatable.print.nrows=100L, # datatable.<argument name> |
| 80 | + datatable.print.topn=5L, # datatable.<argument name> |
| 81 | + datatable.print.class=TRUE, # for print.data.table |
| 82 | + datatable.print.rownames=TRUE, # for print.data.table |
| 83 | + datatable.print.colnames='auto', # for print.data.table |
| 84 | + datatable.print.keys=TRUE, # for print.data.table |
| 85 | + datatable.print.trunc.cols=FALSE, # for print.data.table |
| 86 | + datatable.show.indices=FALSE, # for print.data.table |
| 87 | + datatable.allow.cartesian=FALSE, # datatable.<argument name> |
| 88 | + datatable.join.many=TRUE, # mergelist, [.data.table #4383 #914 |
| 89 | + datatable.dfdispatchwarn=TRUE, # not a function argument |
| 90 | + datatable.warnredundantby=TRUE, # not a function argument |
| 91 | + datatable.alloccol=1024L, # argument 'n' of alloc.col. Over-allocate 1024 spare column slots |
| 92 | + datatable.auto.index=TRUE, # DT[col=="val"] to auto add index so 2nd time faster |
| 93 | + datatable.use.index=TRUE, # global switch to address #1422 |
| 94 | + datatable.prettyprint.char=NULL, # FR #1091 |
| 95 | + datatable.old.matrix.autoname=TRUE # #7145: how data.table(x=1, matrix(1)) is auto-named set to change |
| 96 | + ) |
| 97 | + opts = opts[!names(opts) %chin% names(options())] |
| 98 | + options(opts) |
101 | 99 |
|
102 | 100 | # Test R behaviour that changed in v3.1 and is now depended on |
103 | 101 | x = 1L:3L |
|
0 commit comments