{"action":"created","issue":{"url":"https://api.github.com/repos/pearselab/r-intro-jenessalemon/issues/9","repository_url":"https://api.github.com/repos/pearselab/r-intro-jenessalemon","labels_url":"https://api.github.com/repos/pearselab/r-intro-jenessalemon/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/pearselab/r-intro-jenessalemon/issues/9/comments","events_url":"https://api.github.com/repos/pearselab/r-intro-jenessalemon/issues/9/events","html_url":"https://github.com/pearselab/r-intro-jenessalemon/issues/9","id":187215789,"number":9,"title":"lesson_2 #13","user":{"login":"jenessalemon","id":18506574,"avatar_url":"https://avatars.githubusercontent.com/u/18506574?v=3","gravatar_id":"","url":"https://api.github.com/users/jenessalemon","html_url":"https://github.com/jenessalemon","followers_url":"https://api.github.com/users/jenessalemon/followers","following_url":"https://api.github.com/users/jenessalemon/following{/other_user}","gists_url":"https://api.github.com/users/jenessalemon/gists{/gist_id}","starred_url":"https://api.github.com/users/jenessalemon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenessalemon/subscriptions","organizations_url":"https://api.github.com/users/jenessalemon/orgs","repos_url":"https://api.github.com/users/jenessalemon/repos","events_url":"https://api.github.com/users/jenessalemon/events{/privacy}","received_events_url":"https://api.github.com/users/jenessalemon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-03T23:18:56Z","updated_at":"2016-11-03T23:28:05Z","closed_at":null,"body":"Will and @Wolflab:\r\nI think that writing the algorithm out in English first actually helped a lot. Here is my English part:\r\n\r\nCreate function that takes the number of sites, and vectors of species, and of their p and lambda values\r\ninitialize an empty vector the same size as the number of species\r\nevaluate each species with species.abundance\r\nstore the results in a matrix\r\nreturn the matrix\r\n\r\nI messed around with the syntax and what I came up with starts on line 295. The error says:\r\nError in if (species.presence(p) == 1) { : \r\n  missing value where TRUE/FALSE needed\r\nIn addition: Warning message:\r\nIn rbinom(1, 1, p) : NAs produced\r\n\r\nThe thing that is confusing me is that the errors are coming from the two previous functions that I am calling (species.presence and species.abundance) rather than my new function (hurdle). The previous functions work fine on their own?"},"comment":{"url":"https://api.github.com/repos/pearselab/r-intro-jenessalemon/issues/comments/258304404","html_url":"https://github.com/pearselab/r-intro-jenessalemon/issues/9#issuecomment-258304404","issue_url":"https://api.github.com/repos/pearselab/r-intro-jenessalemon/issues/9","id":258304404,"user":{"login":"Wolflab","id":2801920,"avatar_url":"https://avatars.githubusercontent.com/u/2801920?v=3","gravatar_id":"","url":"https://api.github.com/users/Wolflab","html_url":"https://github.com/Wolflab","followers_url":"https://api.github.com/users/Wolflab/followers","following_url":"https://api.github.com/users/Wolflab/following{/other_user}","gists_url":"https://api.github.com/users/Wolflab/gists{/gist_id}","starred_url":"https://api.github.com/users/Wolflab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wolflab/subscriptions","organizations_url":"https://api.github.com/users/Wolflab/orgs","repos_url":"https://api.github.com/users/Wolflab/repos","events_url":"https://api.github.com/users/Wolflab/events{/privacy}","received_events_url":"https://api.github.com/users/Wolflab/received_events","type":"User","site_admin":false},"created_at":"2016-11-03T23:28:04Z","updated_at":"2016-11-03T23:28:04Z","body":"Everything looks pretty good tome. The thing that looks a bit strange is you are looping across the matrix. The indexing might actually be correct, but I am not sure. You know that each returning vector from  the abundance function is a vector across sites. So now you must be looping across species. Can you see a way to do that, other than looping across the \"results\" matrix? Not sure I am correct but I think this is worth testing"}}
{"actor":{"display_login":"Wolflab"}}