Skip to content

Commit

Permalink
test.data.table try to load only available pkgs, closes #1193
Browse files Browse the repository at this point in the history
  • Loading branch information
jangorecki committed Oct 30, 2015
1 parent 9362c4d commit d6653ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@

14. `fread` with `stringsAsFactors = TRUE` no longer produces factors with NA as a factor level, [#1408](https://github.com/Rdatatable/data.table/pull/1408). Thanks to @DexGroves.

15. `test.data.table` no longer raise warning if suggested packages are not available. Thanks to @jangorecki for PR [#1403](https://github.com/Rdatatable/data.table/pull/1403), closes [#1193](https://github.com/Rdatatable/data.table/issues/1193).

#### NOTES

1. Updated error message on invalid joins to reflect the new `on=` syntax, [#1368](https://github.com/Rdatatable/data.table/issues/1368). Thanks @MichaelChirico.
Expand Down
18 changes: 5 additions & 13 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,14 @@
if (!exists("test.data.table",.GlobalEnv,inherits=FALSE)) {
require(data.table) # in dev the package should not be loaded
options(warn=0) # use require() so it warns but doesn't halt if not available
require(plyr)
require(ggplot2)
require(hexbin)
require(nlme)
require(xts)
require(bit64)
require(gdata)
require(GenomicRanges)
require(caret)
require(knitr)
require(plm)
inst_pkgs = rownames(installed.packages())
sugg_pkgs = c("plyr","ggplot2","hexbin","nlme","xts","bit64","gdata","GenomicRanges","caret","knitr","plm")
lapply(sugg_pkgs, function(pkg) if(pkg %in% inst_pkgs) require(pkg, character.only=TRUE))
# reshape2 ahead of reshape ...
try(detach(package:reshape2),silent=TRUE)
try(detach(package:reshape),silent=TRUE)
library(reshape2, pos="package:base", logical.return=TRUE)
library(reshape, pos="package:base", logical.return=TRUE)
if("reshape2" %in% inst_pkgs) library(reshape2, pos="package:base", logical.return=TRUE)
if("reshape" %in% inst_pkgs) library(reshape, pos="package:base", logical.return=TRUE)
.devtesting=FALSE
} else {
# Matt has suppressMessages(require(bit64)) in .Rprofile
Expand Down

0 comments on commit d6653ed

Please sign in to comment.