{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/devtools/issues/899","labels_url":"https://api.github.com/repos/hadley/devtools/issues/899/labels{/name}","comments_url":"https://api.github.com/repos/hadley/devtools/issues/899/comments","events_url":"https://api.github.com/repos/hadley/devtools/issues/899/events","html_url":"https://github.com/hadley/devtools/issues/899","id":102027853,"number":899,"title":"Incompatibility with shinyjs when loading a package containing definition of a reference class","user":{"login":"chicoscience1","id":13877116,"avatar_url":"https://avatars.githubusercontent.com/u/13877116?v=3","gravatar_id":"","url":"https://api.github.com/users/chicoscience1","html_url":"https://github.com/chicoscience1","followers_url":"https://api.github.com/users/chicoscience1/followers","following_url":"https://api.github.com/users/chicoscience1/following{/other_user}","gists_url":"https://api.github.com/users/chicoscience1/gists{/gist_id}","starred_url":"https://api.github.com/users/chicoscience1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chicoscience1/subscriptions","organizations_url":"https://api.github.com/users/chicoscience1/orgs","repos_url":"https://api.github.com/users/chicoscience1/repos","events_url":"https://api.github.com/users/chicoscience1/events{/privacy}","received_events_url":"https://api.github.com/users/chicoscience1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-20T00:14:11Z","updated_at":"2015-08-20T17:34:57Z","closed_at":null,"body":"I have a simple Shiny app, using the latest version of R (3.2.2), RStudio (0.99.473), all packages up-to-date, tested in both Windows 7 and Ubuntu 14.04. The same thing happens in both SOs.\r\n\r\nI created a small package with a properly created `DESCRIPTION` file called `RTEMP`. I use devtools to load this package. So, the first lines of code in the very simple Shiny app are\r\n\r\n`library(\"devtools\")`\r\n`load_all(\"../../RTEMP\"); `\r\n\r\nThe folder structure where `RTEMP` is doesn't matter\r\n\r\nThis temporary package has one single file inside `RTEMP/R/`, `something.r`. This file contains one line of code:\r\n\r\n`AA <- setRefClass(\"AA\");`\r\n\r\nIt is creating a reference class with nothing but a name. Nothing else is done with this package in the Shiny app, it is only loaded and nothing more.\r\n\r\nWhen running the Shiny app for the first time after opening RStudio, the app loads perfectly. If I close the app and open it again, I get the following error message:\r\n\r\n`ERROR: shinyjs: you cannot mix named and unnamed arguments in the same function call`\r\n\r\nThe problem happens the second time the package is loaded.\r\n\r\nIf, instead, I define the `refClass` inside the app itself:\r\n\r\n`#library(\"devtools\")`\r\n`#load_all(\"../../RTEMP\");`\r\n`AA <- setRefClass(\"AA\");`\r\n\r\n... everything works fine.\r\n\r\nI wonder if devtools fails to properly unload the `refClass` before loading the package for the second time?"},"comment":{"url":"https://api.github.com/repos/hadley/devtools/issues/comments/133088119","html_url":"https://github.com/hadley/devtools/issues/899#issuecomment-133088119","issue_url":"https://api.github.com/repos/hadley/devtools/issues/899","id":133088119,"user":{"login":"chicoscience1","id":13877116,"avatar_url":"https://avatars.githubusercontent.com/u/13877116?v=3","gravatar_id":"","url":"https://api.github.com/users/chicoscience1","html_url":"https://github.com/chicoscience1","followers_url":"https://api.github.com/users/chicoscience1/followers","following_url":"https://api.github.com/users/chicoscience1/following{/other_user}","gists_url":"https://api.github.com/users/chicoscience1/gists{/gist_id}","starred_url":"https://api.github.com/users/chicoscience1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chicoscience1/subscriptions","organizations_url":"https://api.github.com/users/chicoscience1/orgs","repos_url":"https://api.github.com/users/chicoscience1/repos","events_url":"https://api.github.com/users/chicoscience1/events{/privacy}","received_events_url":"https://api.github.com/users/chicoscience1/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T17:34:57Z","updated_at":"2015-08-20T17:34:57Z","body":"I checked devtools source. In file `remove-s4-class.r`, line 50, there is the call to remove class:\r\n\r\n`removeClass(classname, where = nsenv)`\r\n\r\nI wonder if simply adding the `methods` namespace would fix this bug?\r\n\r\n`methods::removeClass(classname, where = nsenv)`"}}