{"action":"opened","issue":{"url":"https://api.github.com/repos/philmikejones/rakeR/issues/68","repository_url":"https://api.github.com/repos/philmikejones/rakeR","labels_url":"https://api.github.com/repos/philmikejones/rakeR/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/philmikejones/rakeR/issues/68/comments","events_url":"https://api.github.com/repos/philmikejones/rakeR/issues/68/events","html_url":"https://github.com/philmikejones/rakeR/issues/68","id":360579255,"node_id":"MDU6SXNzdWUzNjA1NzkyNTU=","number":68,"title":"Refactor/remove checks in functions","user":{"login":"philmikejones","id":5681718,"node_id":"MDQ6VXNlcjU2ODE3MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/5681718?v=4","gravatar_id":"","url":"https://api.github.com/users/philmikejones","html_url":"https://github.com/philmikejones","followers_url":"https://api.github.com/users/philmikejones/followers","following_url":"https://api.github.com/users/philmikejones/following{/other_user}","gists_url":"https://api.github.com/users/philmikejones/gists{/gist_id}","starred_url":"https://api.github.com/users/philmikejones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philmikejones/subscriptions","organizations_url":"https://api.github.com/users/philmikejones/orgs","repos_url":"https://api.github.com/users/philmikejones/repos","events_url":"https://api.github.com/users/philmikejones/events{/privacy}","received_events_url":"https://api.github.com/users/philmikejones/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-15T21:56:16Z","updated_at":"2018-09-15T21:56:16Z","closed_at":null,"author_association":"OWNER","body":"Checks in the middle or at the end of the functions should be refactored or removed, or moved to `tests/`. Currently they're hard to test so code coverage isn't complete.\r\nExample, `rk_weight()`:\r\n```\r\n# The sum of weights will form the simulated population so this must match\r\n  # the population from cons\r\n  if (!isTRUE(all.equal(sum(weights), (sum(cons) / length(vars))))) {\r\n    stop(\"Weight populations don't match constraint populations.\r\n          Usually this means the populations for each of your constraints\r\n          are slightly different\\n\",\r\n         \"Sum of simulated population:  \", sum(weights), \"\\n\",\r\n         \"Sum of constraint population: \", (sum(cons) / length(vars)))\r\n  }\r\n```"}}
{"actor":{"display_login":"philmikejones"}}