Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.data.table try to load only available pkgs, closes #1193 #1403

Merged
merged 1 commit into from
Oct 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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