{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/devtools/issues/192","repository_url":"https://api.github.com/repos/hadley/devtools","labels_url":"https://api.github.com/repos/hadley/devtools/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/hadley/devtools/issues/192/comments","events_url":"https://api.github.com/repos/hadley/devtools/issues/192/events","html_url":"https://github.com/hadley/devtools/issues/192","id":8293006,"number":192,"title":"devtools::test when package Depends on data.table, but does not import it","user":{"login":"gsee","id":1143691,"avatar_url":"https://avatars.githubusercontent.com/u/1143691?v=3","gravatar_id":"","url":"https://api.github.com/users/gsee","html_url":"https://github.com/gsee","followers_url":"https://api.github.com/users/gsee/followers","following_url":"https://api.github.com/users/gsee/following{/other_user}","gists_url":"https://api.github.com/users/gsee/gists{/gist_id}","starred_url":"https://api.github.com/users/gsee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsee/subscriptions","organizations_url":"https://api.github.com/users/gsee/orgs","repos_url":"https://api.github.com/users/gsee/repos","events_url":"https://api.github.com/users/gsee/events{/privacy}","received_events_url":"https://api.github.com/users/gsee/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2012-11-12T15:48:23Z","updated_at":"2016-04-11T16:24:52Z","closed_at":"2012-12-14T16:31:00Z","body":"When a package Depends on data.table (and does not import it), sometimes using devtools::test on the package can break some functions that use data.table.  I filed a bug report for data.table, but it's not clear that is a data.table issue.  Here is the link to the data.table bug report: https://r-forge.r-project.org/tracker/?func=detail&atid=975&aid=2367&group_id=240\r\n\r\nI don't see a way to attach files to this, but here is a link (that should be a direct download) to the package that I attached to the data.table bug report: https://r-forge.r-project.org/tracker/download.php/240/975/2367/275/anRpackage_1.0.tar.gz\r\n\r\nThe package has 2 functions: myFun assigns some values to a column of a data.table by reference.  myFun2() creates a data.table, and then calls myFun() to change the values of one of the columns of the data.table myFun2() created.\r\n\r\nThe package also has a testthat test that simply tests that myFun2 returns a data.table.\r\n\r\nThe package passes R CMD check, and test_dir.  However, if I use devtools::test, I get an error, and for the remainder of the R session, myFun() and myFun2() will fail with the same error.\r\n\r\nHere is a link to the output from an interactive session (attached to the data.table bug report) showing the problem: https://r-forge.r-project.org/tracker/download.php/240/975/2367/276/interactive.txt\r\n"},"comment":{"url":"https://api.github.com/repos/hadley/devtools/issues/comments/208434035","html_url":"https://github.com/hadley/devtools/issues/192#issuecomment-208434035","issue_url":"https://api.github.com/repos/hadley/devtools/issues/192","id":208434035,"user":{"login":"utalo","id":18393022,"avatar_url":"https://avatars.githubusercontent.com/u/18393022?v=3","gravatar_id":"","url":"https://api.github.com/users/utalo","html_url":"https://github.com/utalo","followers_url":"https://api.github.com/users/utalo/followers","following_url":"https://api.github.com/users/utalo/following{/other_user}","gists_url":"https://api.github.com/users/utalo/gists{/gist_id}","starred_url":"https://api.github.com/users/utalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/utalo/subscriptions","organizations_url":"https://api.github.com/users/utalo/orgs","repos_url":"https://api.github.com/users/utalo/repos","events_url":"https://api.github.com/users/utalo/events{/privacy}","received_events_url":"https://api.github.com/users/utalo/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T16:24:52Z","updated_at":"2016-04-11T16:24:52Z","body":"I seem to be encountering the same issue as discussed above. I posted a related question on stackoverflow: http://stackoverflow.com/questions/36547235/r-data-table-and-testthat-package\r\nReproducible code example can be found here: https://github.com/utalo/test_datatable_testthat\r\nI am using R-3.2.3, data.table 1.9.6 and devtools 1.10.0."}}