{"action":"created","issue":{"url":"https://api.github.com/repos/HenrikBengtsson/R.methodsS3/issues/11","repository_url":"https://api.github.com/repos/HenrikBengtsson/R.methodsS3","labels_url":"https://api.github.com/repos/HenrikBengtsson/R.methodsS3/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/HenrikBengtsson/R.methodsS3/issues/11/comments","events_url":"https://api.github.com/repos/HenrikBengtsson/R.methodsS3/issues/11/events","html_url":"https://github.com/HenrikBengtsson/R.methodsS3/issues/11","id":311849000,"number":11,"title":"Option/env var for producing NAMESPACE output","user":{"login":"HenrikBengtsson","id":1616850,"avatar_url":"https://avatars0.githubusercontent.com/u/1616850?v=4","gravatar_id":"","url":"https://api.github.com/users/HenrikBengtsson","html_url":"https://github.com/HenrikBengtsson","followers_url":"https://api.github.com/users/HenrikBengtsson/followers","following_url":"https://api.github.com/users/HenrikBengtsson/following{/other_user}","gists_url":"https://api.github.com/users/HenrikBengtsson/gists{/gist_id}","starred_url":"https://api.github.com/users/HenrikBengtsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HenrikBengtsson/subscriptions","organizations_url":"https://api.github.com/users/HenrikBengtsson/orgs","repos_url":"https://api.github.com/users/HenrikBengtsson/repos","events_url":"https://api.github.com/users/HenrikBengtsson/events{/privacy}","received_events_url":"https://api.github.com/users/HenrikBengtsson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/HenrikBengtsson/R.methodsS3/milestones/1","html_url":"https://github.com/HenrikBengtsson/R.methodsS3/milestone/1","labels_url":"https://api.github.com/repos/HenrikBengtsson/R.methodsS3/milestones/1/labels","id":891785,"number":1,"title":"Next Release","description":"","creator":{"login":"HenrikBengtsson","id":1616850,"avatar_url":"https://avatars0.githubusercontent.com/u/1616850?v=4","gravatar_id":"","url":"https://api.github.com/users/HenrikBengtsson","html_url":"https://github.com/HenrikBengtsson","followers_url":"https://api.github.com/users/HenrikBengtsson/followers","following_url":"https://api.github.com/users/HenrikBengtsson/following{/other_user}","gists_url":"https://api.github.com/users/HenrikBengtsson/gists{/gist_id}","starred_url":"https://api.github.com/users/HenrikBengtsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HenrikBengtsson/subscriptions","organizations_url":"https://api.github.com/users/HenrikBengtsson/orgs","repos_url":"https://api.github.com/users/HenrikBengtsson/repos","events_url":"https://api.github.com/users/HenrikBengtsson/events{/privacy}","received_events_url":"https://api.github.com/users/HenrikBengtsson/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2014-12-04T17:47:43Z","updated_at":"2018-04-06T05:04:42Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-04-06T05:04:36Z","updated_at":"2018-04-06T05:25:54Z","closed_at":null,"author_association":"OWNER","body":"With recent R-devel (to become 3.6.0) changes that tightens up the S3 method dispatching, it can be hard to identify S3 methods that has been forgotten to be registered in the NAMESPACE file, particularly if the NAMESPACE file is edited manually.\r\n\r\n# Suggestion\r\nAdd an R option/environment variable that will produce NAMESPACE output when using `setMethodS3()`.\r\n\r\nI think this can only be produced when a package that uses `setMethodS3()` is *installed* (hence an environment variable; since R options cannot be set).  When *loading*/*attaching* the package, the `setMethodS3()` function is not called.  Alternatively, as a poor man's version, one can `source()` all R files in the package directory to explicitly call `setMethodS3()`.\r\n\r\n* Environment variable: `R_R_METHODSS3_OUTPUT=NAMESPACE`\r\n* R option: `options(R.methodsS3.output = Sys.getenv(R_R_METHODSS3_OUTPUT = \"NAMESPACE\"))`.\r\n"},"comment":{"url":"https://api.github.com/repos/HenrikBengtsson/R.methodsS3/issues/comments/379151652","html_url":"https://github.com/HenrikBengtsson/R.methodsS3/issues/11#issuecomment-379151652","issue_url":"https://api.github.com/repos/HenrikBengtsson/R.methodsS3/issues/11","id":379151652,"user":{"login":"HenrikBengtsson","id":1616850,"avatar_url":"https://avatars0.githubusercontent.com/u/1616850?v=4","gravatar_id":"","url":"https://api.github.com/users/HenrikBengtsson","html_url":"https://github.com/HenrikBengtsson","followers_url":"https://api.github.com/users/HenrikBengtsson/followers","following_url":"https://api.github.com/users/HenrikBengtsson/following{/other_user}","gists_url":"https://api.github.com/users/HenrikBengtsson/gists{/gist_id}","starred_url":"https://api.github.com/users/HenrikBengtsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HenrikBengtsson/subscriptions","organizations_url":"https://api.github.com/users/HenrikBengtsson/orgs","repos_url":"https://api.github.com/users/HenrikBengtsson/repos","events_url":"https://api.github.com/users/HenrikBengtsson/events{/privacy}","received_events_url":"https://api.github.com/users/HenrikBengtsson/received_events","type":"User","site_admin":false},"created_at":"2018-04-06T05:25:54Z","updated_at":"2018-04-06T05:25:54Z","author_association":"OWNER","body":"OTH, for any package than uses R.methodsS3, we can use the following to produce `S3method()` output:\r\n```r\r\nnamespace_s3method <- function(pkg) {\r\n  ns <- getNamespace(pkg)\r\n  for (name in ls(envir = ns)) { \r\n    fcn <- get(name, envir = ns)\r\n    if (!is.function(fcn)) next\r\n    s3class <- attr(fcn, \"S3class\")\r\n    if (is.null(s3class)) next\r\n    cat(sprintf('S3method(\"%s\", \"%s\")\\n', name, s3class))\r\n  }\r\n}\r\n```\r\n\r\nFor example\r\n```r\r\n> namespace_s3method(\"R.devices\")\r\nS3method(\"!.DevEvalProduct\", \"DevEvalProduct\")\r\nS3method(\"[[.DevEvalProduct\", \"DevEvalProduct\")\r\nS3method(\"$.DevEvalProduct\", \"DevEvalProduct\")\r\nS3method(\"as.character.DevEvalFileProduct\", \"DevEvalFileProduct\")\r\nS3method(\"as.character.DevEvalProduct\", \"DevEvalProduct\")\r\nS3method(\"getData.DevEvalFileProduct\", \"DevEvalFileProduct\")\r\nS3method(\"getDataURI.DevEvalFileProduct\", \"DevEvalFileProduct\")\r\nS3method(\"getExtension.DevEvalFileProduct\", \"DevEvalFileProduct\")\r\nS3method(\"getFilename.DevEvalFileProduct\", \"DevEvalFileProduct\")\r\nS3method(\"getFullname.DevEvalFileProduct\", \"DevEvalFileProduct\")\r\nS3method(\"getFullname.DevEvalProduct\", \"DevEvalProduct\")\r\nS3method(\"getMime.DevEvalFileProduct\", \"DevEvalFileProduct\")\r\nS3method(\"getMimeType.DevEvalFileProduct\", \"DevEvalFileProduct\")\r\nS3method(\"getName.DevEvalProduct\", \"DevEvalProduct\")\r\nS3method(\"getPath.DevEvalFileProduct\", \"DevEvalFileProduct\")\r\nS3method(\"getPathname.DevEvalFileProduct\", \"DevEvalFileProduct\")\r\nS3method(\"getTags.DevEvalProduct\", \"DevEvalProduct\")\r\nS3method(\"getType.DevEvalProduct\", \"DevEvalProduct\")\r\nS3method(\"view.DevEvalFileProduct\", \"DevEvalFileProduct\")\r\nS3method(\"view.DevEvalProduct\", \"DevEvalProduct\")\r\n```"}}
{"actor":{"display_login":"HenrikBengtsson"}}