{"action":"created","issue":{"url":"https://api.github.com/repos/kaneplusplus/bigmemory/issues/88","repository_url":"https://api.github.com/repos/kaneplusplus/bigmemory","labels_url":"https://api.github.com/repos/kaneplusplus/bigmemory/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/kaneplusplus/bigmemory/issues/88/comments","events_url":"https://api.github.com/repos/kaneplusplus/bigmemory/issues/88/events","html_url":"https://github.com/kaneplusplus/bigmemory/issues/88","id":363187067,"node_id":"MDU6SXNzdWUzNjMxODcwNjc=","number":88,"title":"diag function","user":{"login":"cdeterman","id":3091179,"node_id":"MDQ6VXNlcjMwOTExNzk=","avatar_url":"https://avatars2.githubusercontent.com/u/3091179?v=4","gravatar_id":"","url":"https://api.github.com/users/cdeterman","html_url":"https://github.com/cdeterman","followers_url":"https://api.github.com/users/cdeterman/followers","following_url":"https://api.github.com/users/cdeterman/following{/other_user}","gists_url":"https://api.github.com/users/cdeterman/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeterman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeterman/subscriptions","organizations_url":"https://api.github.com/users/cdeterman/orgs","repos_url":"https://api.github.com/users/cdeterman/repos","events_url":"https://api.github.com/users/cdeterman/events{/privacy}","received_events_url":"https://api.github.com/users/cdeterman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-24T15:03:11Z","updated_at":"2018-09-24T15:57:49Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"In reference to the SO question [here](https://stackoverflow.com/questions/52447386/calculate-the-diagonal-of-a-big-matrix-in-r) perhaps it would be a good idea to implement the `diag` function in `bigmemory`?  Given that it is just a way of accessing the elements within the matrix I think it is most appropriate for it to be within `bigmemory`.  The question would just come down to do we want to simply provide a wrapper using the special matrix accessor, as provided in @privefl answer, or would it be better to implement in C++?\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/kaneplusplus/bigmemory/issues/comments/424027453","html_url":"https://github.com/kaneplusplus/bigmemory/issues/88#issuecomment-424027453","issue_url":"https://api.github.com/repos/kaneplusplus/bigmemory/issues/88","id":424027453,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDAyNzQ1Mw==","user":{"login":"cdeterman","id":3091179,"node_id":"MDQ6VXNlcjMwOTExNzk=","avatar_url":"https://avatars2.githubusercontent.com/u/3091179?v=4","gravatar_id":"","url":"https://api.github.com/users/cdeterman","html_url":"https://github.com/cdeterman","followers_url":"https://api.github.com/users/cdeterman/followers","following_url":"https://api.github.com/users/cdeterman/following{/other_user}","gists_url":"https://api.github.com/users/cdeterman/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeterman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeterman/subscriptions","organizations_url":"https://api.github.com/users/cdeterman/orgs","repos_url":"https://api.github.com/users/cdeterman/repos","events_url":"https://api.github.com/users/cdeterman/events{/privacy}","received_events_url":"https://api.github.com/users/cdeterman/received_events","type":"User","site_admin":false},"created_at":"2018-09-24T15:57:49Z","updated_at":"2018-09-24T15:57:49Z","author_association":"CONTRIBUTOR","body":"@privefl That is perfectly fine with me.  The only thing I am suggesting is wrapping those lines in a `diag` method so a user can simply call\r\n\r\n```r\r\ndiag(big_mat)\r\n```\r\n\r\nIt is simply more convenient and expected with matrix operations.  Either as an S4 or S3 method I don't think matters too much in this case.  At least that is my two cents."}}
{"actor":{"display_login":"cdeterman"}}