{"action":"created","issue":{"url":"https://api.github.com/repos/ropensci/ecoretriever/issues/51","labels_url":"https://api.github.com/repos/ropensci/ecoretriever/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/ropensci/ecoretriever/issues/51/comments","events_url":"https://api.github.com/repos/ropensci/ecoretriever/issues/51/events","html_url":"https://github.com/ropensci/ecoretriever/pull/51","id":73650886,"number":51,"title":"Improve update per discussion in #49","user":{"login":"dmcglinn","id":1190381,"avatar_url":"https://avatars.githubusercontent.com/u/1190381?v=3","gravatar_id":"","url":"https://api.github.com/users/dmcglinn","html_url":"https://github.com/dmcglinn","followers_url":"https://api.github.com/users/dmcglinn/followers","following_url":"https://api.github.com/users/dmcglinn/following{/other_user}","gists_url":"https://api.github.com/users/dmcglinn/gists{/gist_id}","starred_url":"https://api.github.com/users/dmcglinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmcglinn/subscriptions","organizations_url":"https://api.github.com/users/dmcglinn/orgs","repos_url":"https://api.github.com/users/dmcglinn/repos","events_url":"https://api.github.com/users/dmcglinn/events{/privacy}","received_events_url":"https://api.github.com/users/dmcglinn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-06T15:10:27Z","updated_at":"2015-05-06T19:46:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ropensci/ecoretriever/pulls/51","html_url":"https://github.com/ropensci/ecoretriever/pull/51","diff_url":"https://github.com/ropensci/ecoretriever/pull/51.diff","patch_url":"https://github.com/ropensci/ecoretriever/pull/51.patch"},"body":"These modifications replace the automatic update of retriever scripts on package load with a function called `get_updates()` which must be called manually by the user. The user is encouraged to run `get_updates()` when the package is attached. @ethanwhite can you please look at the `get_updates()` documentation specifically I tried to explain that `retriever update` only checks to see if the user has the most recent official release version of the scripts and not the full set up available updates that are on the retriever repo. Is this correct and did I communicate that clearly?"},"comment":{"url":"https://api.github.com/repos/ropensci/ecoretriever/issues/comments/99584708","html_url":"https://github.com/ropensci/ecoretriever/pull/51#issuecomment-99584708","issue_url":"https://api.github.com/repos/ropensci/ecoretriever/issues/51","id":99584708,"user":{"login":"gavinsimpson","id":514696,"avatar_url":"https://avatars.githubusercontent.com/u/514696?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinsimpson","html_url":"https://github.com/gavinsimpson","followers_url":"https://api.github.com/users/gavinsimpson/followers","following_url":"https://api.github.com/users/gavinsimpson/following{/other_user}","gists_url":"https://api.github.com/users/gavinsimpson/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinsimpson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinsimpson/subscriptions","organizations_url":"https://api.github.com/users/gavinsimpson/orgs","repos_url":"https://api.github.com/users/gavinsimpson/repos","events_url":"https://api.github.com/users/gavinsimpson/events{/privacy}","received_events_url":"https://api.github.com/users/gavinsimpson/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T19:46:20Z","updated_at":"2015-05-06T19:46:20Z","body":"@davharris is right about using `message()` or `cat()` (I find `writeLines(strwrap(string))` easier to use myself so that is another option and it'll wrap the text at the console width by default.). `print()` is for showing a representation of an object at the R level - you rarely want this when handling output in the form of text like this.\r\n\r\nI would propose a slight alternative; don't have `get_updates()` *print* anything, but instead have it return an object containing the information you might capture from `retriever update`, give the returned object a class and write an S3 `print` method for that class. That way, when you do:\r\n\r\n```r\r\nget_updates()\r\n```\r\n\r\nYou would still get the printed output but if you did\r\n\r\n```r\r\nfoo <- get_updates()\r\n```\r\n\r\nyou would not see any messages unless you printed `foo`, but a user could go on an do other things with `foo`.\r\n\r\nThe point of this is to separate the update step from the reporting step.\r\n\r\nSome other points:\r\n\r\n * Consider changing `get_updates()` to use `system2` - it does seem to be the more recommended way of doing system calls now. With that you can capture the output to stdout that the system call produces and return that information (which could be printed via the print method).\r\n * Use `\\url{uniform_resource_locator}` in the roxygen documentation to apply the appropriate Rd markup for a URL on [this line](https://github.com/ropensci/ecoretriever/pull/51/files#diff-f9521e732907d321d98b8266cce335fdR144)\r\n * Likewise, on [Line 142](https://github.com/ropensci/ecoretriever/pull/51/files#diff-f9521e732907d321d98b8266cce335fdR144) use `\\file{file_name}` to indicate the directory in correct Rd markup.\r\n * You should probably have a `@keywords` tag in the roxygen block to indicate which of the official R `KEYWORDS` this function falls under. You can see the full list [here](https://svn.r-project.org/R/trunk/doc/KEYWORDS) but I suggest\r\n\r\n    ```r\r\n    #' @keywords utilities\r\n    ```\r\n    \r\n    and you might potentially add `database` to the list too, i.e.\r\n    \r\n    ```r\r\n    #' @keywords utilities database\r\n    ```\r\n"}}