{"action":"created","issue":{"url":"https://api.github.com/repos/klutometis/roxygen/issues/533","repository_url":"https://api.github.com/repos/klutometis/roxygen","labels_url":"https://api.github.com/repos/klutometis/roxygen/issues/533/labels{/name}","comments_url":"https://api.github.com/repos/klutometis/roxygen/issues/533/comments","events_url":"https://api.github.com/repos/klutometis/roxygen/issues/533/events","html_url":"https://github.com/klutometis/roxygen/issues/533","id":185371464,"number":533,"title":"devtools::document() error for global variable that uses an external function","user":{"login":"fangly","id":231905,"avatar_url":"https://avatars.githubusercontent.com/u/231905?v=3","gravatar_id":"","url":"https://api.github.com/users/fangly","html_url":"https://github.com/fangly","followers_url":"https://api.github.com/users/fangly/followers","following_url":"https://api.github.com/users/fangly/following{/other_user}","gists_url":"https://api.github.com/users/fangly/gists{/gist_id}","starred_url":"https://api.github.com/users/fangly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fangly/subscriptions","organizations_url":"https://api.github.com/users/fangly/orgs","repos_url":"https://api.github.com/users/fangly/repos","events_url":"https://api.github.com/users/fangly/events{/privacy}","received_events_url":"https://api.github.com/users/fangly/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-26T11:50:30Z","updated_at":"2016-10-27T06:37:09Z","closed_at":"2016-10-26T13:28:53Z","body":"Hi,\r\n\r\nI am trying to set some constants, i.e. read-only global variables, in a package I am writing. But I have a roxygen2 problem when running devtools::document():\r\n\r\n```\r\n> devtools::document()\r\nUpdating dummy documentation\r\nLoading dummy\r\nError in eval(expr, envir, enclos) (from constants.R#4) : \r\n  could not find function \"as.integer64\"\r\n```\r\nThe traceback looks like:\r\n```\r\n> traceback()\r\n9: eval(expr, envir, enclos)\r\n8: eval(exprs[i], envir)\r\n7: source_one(file, envir = envir)\r\n6: source_many(paths, env)\r\n5: force(code)\r\n4: withr_with_dir(file.path(pkg$path), source_many(paths, env))\r\n3: load_code(pkg)\r\n2: load_all(pkg)\r\n1: devtools::document()\r\n```\r\n\r\nMy minimal R example file, \"constants.R\" looks like this:\r\n```R\r\n#' @importFrom bit64  as.integer64\r\nNULL\r\n\r\nCONSTANT <- as.integer64(123)\r\n```\r\n\r\nAnd the \"Imports:\" section of my DESCRIPTION file does list the bit64 package, so, there really is no reason that \"as.integer64\" should not be found.\r\n\r\nFully qualifying the external functions (replacing as.integer64 by bit64::as.integer64 in the code) allows devtools::document() to run through and generate the NAMESPACE file, as expected. From then on, it's possible to revert to \"as.integer64\" (not fully qualified) and to run devtools::document() again without issues. Try to remove NAMESPACE, do a \"clean & rebuild\" in RStudio, a devtools::document() and the problem pops up again.\r\n\r\nNote that if I use roxygen2::roxygenize() instead of devtools::document(), the problem goes away.\r\n\r\nCheers,\r\n\r\nFlorent\r\n\r\nPS/ R 3.2.5, roxygen2 5.0.1, RStudio 1.0.44"},"comment":{"url":"https://api.github.com/repos/klutometis/roxygen/issues/comments/256558911","html_url":"https://github.com/klutometis/roxygen/issues/533#issuecomment-256558911","issue_url":"https://api.github.com/repos/klutometis/roxygen/issues/533","id":256558911,"user":{"login":"fangly","id":231905,"avatar_url":"https://avatars.githubusercontent.com/u/231905?v=3","gravatar_id":"","url":"https://api.github.com/users/fangly","html_url":"https://github.com/fangly","followers_url":"https://api.github.com/users/fangly/followers","following_url":"https://api.github.com/users/fangly/following{/other_user}","gists_url":"https://api.github.com/users/fangly/gists{/gist_id}","starred_url":"https://api.github.com/users/fangly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fangly/subscriptions","organizations_url":"https://api.github.com/users/fangly/orgs","repos_url":"https://api.github.com/users/fangly/repos","events_url":"https://api.github.com/users/fangly/events{/privacy}","received_events_url":"https://api.github.com/users/fangly/received_events","type":"User","site_admin":false},"created_at":"2016-10-27T06:37:09Z","updated_at":"2016-10-27T06:37:09Z","body":"Got you, thank you for the explanations.\r\nFlorent"}}
{"actor":{"display_login":"fangly"}}