{"action":"created","comment":{"url":"https://api.github.com/repos/almartin82/mapvizieR/pulls/comments/31871877","id":31871877,"diff_hunk":"@@ -0,0 +1,103 @@\n+#' @title estimate RIT score for a student using regression or interpolation\n+#' \n+#' @description Given studentid, measurementscale, and a target_date, the \n+#' function will return an estimated score based on selected method \n+#' \n+#' @param mapvizieR_obj mapvizieR object\n+#' @param sid target studentid\n+#' @param measurescale target subject\n+#' @param target_date date of interest, %Y-%m-%d format\n+#' @param method which method to use to estimate RIT score\n+#' @param foward default is TRUE, set to FALSE if only scores before target_date should be chosen for 'closest' method\n+#' \n+#' @export\n+\n+\n+estimate_rit <- function(\n+  mapvizieR_obj,\n+  sid,\n+  measurescale,\n+  target_date,\n+  method = c('closest','lm','interpolate'),\n+  forward = TRUE\n+) {\n+  \n+  # throw an error if method is not given\n+  if (missing(method)) {\n+    stop('method not given')\n+  }\n+  \n+  # pull out the cdf\n+  cdf <- mapvizieR_obj[['cdf']]\n+  \n+  target_date <- as.Date(target_date)\n+  \n+  # find the matchings rows\n+  if (require(dplyr)) {\n+    student <- cdf %>% dplyr::filter(studentid == sid,","path":"R/estimate_RIT.R","position":37,"original_position":37,"commit_id":"ad352efa8117a14ff6592f9d63ab7d1b7088da99","original_commit_id":"ad352efa8117a14ff6592f9d63ab7d1b7088da99","user":{"login":"almartin82","id":782135,"avatar_url":"https://avatars.githubusercontent.com/u/782135?v=3","gravatar_id":"","url":"https://api.github.com/users/almartin82","html_url":"https://github.com/almartin82","followers_url":"https://api.github.com/users/almartin82/followers","following_url":"https://api.github.com/users/almartin82/following{/other_user}","gists_url":"https://api.github.com/users/almartin82/gists{/gist_id}","starred_url":"https://api.github.com/users/almartin82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almartin82/subscriptions","organizations_url":"https://api.github.com/users/almartin82/orgs","repos_url":"https://api.github.com/users/almartin82/repos","events_url":"https://api.github.com/users/almartin82/events{/privacy}","received_events_url":"https://api.github.com/users/almartin82/received_events","type":"User","site_admin":false},"body":"fully qualifying the namespace (eg `dplyr::`) is :+1:  - that's our convention for mapvizier!","created_at":"2015-06-06T21:47:43Z","updated_at":"2015-06-06T21:47:43Z","html_url":"https://github.com/almartin82/mapvizieR/pull/111#discussion_r31871877","pull_request_url":"https://api.github.com/repos/almartin82/mapvizieR/pulls/111","_links":{"self":{"href":"https://api.github.com/repos/almartin82/mapvizieR/pulls/comments/31871877"},"html":{"href":"https://github.com/almartin82/mapvizieR/pull/111#discussion_r31871877"},"pull_request":{"href":"https://api.github.com/repos/almartin82/mapvizieR/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/almartin82/mapvizieR/pulls/111","id":37063362,"html_url":"https://github.com/almartin82/mapvizieR/pull/111","diff_url":"https://github.com/almartin82/mapvizieR/pull/111.diff","patch_url":"https://github.com/almartin82/mapvizieR/pull/111.patch","issue_url":"https://api.github.com/repos/almartin82/mapvizieR/issues/111","number":111,"state":"open","locked":false,"title":"estimate_rit function","user":{"login":"kimjam","id":7191765,"avatar_url":"https://avatars.githubusercontent.com/u/7191765?v=3","gravatar_id":"","url":"https://api.github.com/users/kimjam","html_url":"https://github.com/kimjam","followers_url":"https://api.github.com/users/kimjam/followers","following_url":"https://api.github.com/users/kimjam/following{/other_user}","gists_url":"https://api.github.com/users/kimjam/gists{/gist_id}","starred_url":"https://api.github.com/users/kimjam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimjam/subscriptions","organizations_url":"https://api.github.com/users/kimjam/orgs","repos_url":"https://api.github.com/users/kimjam/repos","events_url":"https://api.github.com/users/kimjam/events{/privacy}","received_events_url":"https://api.github.com/users/kimjam/received_events","type":"User","site_admin":false},"body":"estimate_RIT.R contains function to estimate a student's RIT score given a mapvizieR object, studentid, measurementscale, target date, and method. The first method is closest by date and the user can choose whether only scores before the target date are used using the forward parameter. The second method is a linear regression using all test scores. The final method is interpolation using the two scores that contain the target date. test_estimate_rit.R contains tests that will return particular scores, a numeric value, or an NA with a message. \r\n\r\nI think the functionality is there, but it may not be the most efficient methodology. Any thoughts on code would be appreciated.","created_at":"2015-06-05T19:41:10Z","updated_at":"2015-06-06T21:47:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a8a1fcff957025df28441de195323a37860d1ff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/almartin82/mapvizieR/pulls/111/commits","review_comments_url":"https://api.github.com/repos/almartin82/mapvizieR/pulls/111/comments","review_comment_url":"https://api.github.com/repos/almartin82/mapvizieR/pulls/comments{/number}","comments_url":"https://api.github.com/repos/almartin82/mapvizieR/issues/111/comments","statuses_url":"https://api.github.com/repos/almartin82/mapvizieR/statuses/ad352efa8117a14ff6592f9d63ab7d1b7088da99","head":{"label":"almartin82:rit_by_date","ref":"rit_by_date","sha":"ad352efa8117a14ff6592f9d63ab7d1b7088da99","user":{"login":"almartin82","id":782135,"avatar_url":"https://avatars.githubusercontent.com/u/782135?v=3","gravatar_id":"","url":"https://api.github.com/users/almartin82","html_url":"https://github.com/almartin82","followers_url":"https://api.github.com/users/almartin82/followers","following_url":"https://api.github.com/users/almartin82/following{/other_user}","gists_url":"https://api.github.com/users/almartin82/gists{/gist_id}","starred_url":"https://api.github.com/users/almartin82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almartin82/subscriptions","organizations_url":"https://api.github.com/users/almartin82/orgs","repos_url":"https://api.github.com/users/almartin82/repos","events_url":"https://api.github.com/users/almartin82/events{/privacy}","received_events_url":"https://api.github.com/users/almartin82/received_events","type":"User","site_admin":false},"repo":{"id":29256180,"name":"mapvizieR","full_name":"almartin82/mapvizieR","owner":{"login":"almartin82","id":782135,"avatar_url":"https://avatars.githubusercontent.com/u/782135?v=3","gravatar_id":"","url":"https://api.github.com/users/almartin82","html_url":"https://github.com/almartin82","followers_url":"https://api.github.com/users/almartin82/followers","following_url":"https://api.github.com/users/almartin82/following{/other_user}","gists_url":"https://api.github.com/users/almartin82/gists{/gist_id}","starred_url":"https://api.github.com/users/almartin82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almartin82/subscriptions","organizations_url":"https://api.github.com/users/almartin82/orgs","repos_url":"https://api.github.com/users/almartin82/repos","events_url":"https://api.github.com/users/almartin82/events{/privacy}","received_events_url":"https://api.github.com/users/almartin82/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/almartin82/mapvizieR","description":"","fork":false,"url":"https://api.github.com/repos/almartin82/mapvizieR","forks_url":"https://api.github.com/repos/almartin82/mapvizieR/forks","keys_url":"https://api.github.com/repos/almartin82/mapvizieR/keys{/key_id}","collaborators_url":"https://api.github.com/repos/almartin82/mapvizieR/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/almartin82/mapvizieR/teams","hooks_url":"https://api.github.com/repos/almartin82/mapvizieR/hooks","issue_events_url":"https://api.github.com/repos/almartin82/mapvizieR/issues/events{/number}","events_url":"https://api.github.com/repos/almartin82/mapvizieR/events","assignees_url":"https://api.github.com/repos/almartin82/mapvizieR/assignees{/user}","branches_url":"https://api.github.com/repos/almartin82/mapvizieR/branches{/branch}","tags_url":"https://api.github.com/repos/almartin82/mapvizieR/tags","blobs_url":"https://api.github.com/repos/almartin82/mapvizieR/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/almartin82/mapvizieR/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/almartin82/mapvizieR/git/refs{/sha}","trees_url":"https://api.github.com/repos/almartin82/mapvizieR/git/trees{/sha}","statuses_url":"https://api.github.com/repos/almartin82/mapvizieR/statuses/{sha}","languages_url":"https://api.github.com/repos/almartin82/mapvizieR/languages","stargazers_url":"https://api.github.com/repos/almartin82/mapvizieR/stargazers","contributors_url":"https://api.github.com/repos/almartin82/mapvizieR/contributors","subscribers_url":"https://api.github.com/repos/almartin82/mapvizieR/subscribers","subscription_url":"https://api.github.com/repos/almartin82/mapvizieR/subscription","commits_url":"https://api.github.com/repos/almartin82/mapvizieR/commits{/sha}","git_commits_url":"https://api.github.com/repos/almartin82/mapvizieR/git/commits{/sha}","comments_url":"https://api.github.com/repos/almartin82/mapvizieR/comments{/number}","issue_comment_url":"https://api.github.com/repos/almartin82/mapvizieR/issues/comments{/number}","contents_url":"https://api.github.com/repos/almartin82/mapvizieR/contents/{+path}","compare_url":"https://api.github.com/repos/almartin82/mapvizieR/compare/{base}...{head}","merges_url":"https://api.github.com/repos/almartin82/mapvizieR/merges","archive_url":"https://api.github.com/repos/almartin82/mapvizieR/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/almartin82/mapvizieR/downloads","issues_url":"https://api.github.com/repos/almartin82/mapvizieR/issues{/number}","pulls_url":"https://api.github.com/repos/almartin82/mapvizieR/pulls{/number}","milestones_url":"https://api.github.com/repos/almartin82/mapvizieR/milestones{/number}","notifications_url":"https://api.github.com/repos/almartin82/mapvizieR/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/almartin82/mapvizieR/labels{/name}","releases_url":"https://api.github.com/repos/almartin82/mapvizieR/releases{/id}","created_at":"2015-01-14T17:23:32Z","updated_at":"2015-05-28T21:24:14Z","pushed_at":"2015-06-05T19:41:10Z","git_url":"git://github.com/almartin82/mapvizieR.git","ssh_url":"git@github.com:almartin82/mapvizieR.git","clone_url":"https://github.com/almartin82/mapvizieR.git","svn_url":"https://github.com/almartin82/mapvizieR","homepage":null,"size":3503,"stargazers_count":3,"watchers_count":3,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":19,"forks":2,"open_issues":19,"watchers":3,"default_branch":"master"}},"base":{"label":"almartin82:master","ref":"master","sha":"b94dfbf8ea778fe00076adbe90d145e7ff20ceda","user":{"login":"almartin82","id":782135,"avatar_url":"https://avatars.githubusercontent.com/u/782135?v=3","gravatar_id":"","url":"https://api.github.com/users/almartin82","html_url":"https://github.com/almartin82","followers_url":"https://api.github.com/users/almartin82/followers","following_url":"https://api.github.com/users/almartin82/following{/other_user}","gists_url":"https://api.github.com/users/almartin82/gists{/gist_id}","starred_url":"https://api.github.com/users/almartin82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almartin82/subscriptions","organizations_url":"https://api.github.com/users/almartin82/orgs","repos_url":"https://api.github.com/users/almartin82/repos","events_url":"https://api.github.com/users/almartin82/events{/privacy}","received_events_url":"https://api.github.com/users/almartin82/received_events","type":"User","site_admin":false},"repo":{"id":29256180,"name":"mapvizieR","full_name":"almartin82/mapvizieR","owner":{"login":"almartin82","id":782135,"avatar_url":"https://avatars.githubusercontent.com/u/782135?v=3","gravatar_id":"","url":"https://api.github.com/users/almartin82","html_url":"https://github.com/almartin82","followers_url":"https://api.github.com/users/almartin82/followers","following_url":"https://api.github.com/users/almartin82/following{/other_user}","gists_url":"https://api.github.com/users/almartin82/gists{/gist_id}","starred_url":"https://api.github.com/users/almartin82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almartin82/subscriptions","organizations_url":"https://api.github.com/users/almartin82/orgs","repos_url":"https://api.github.com/users/almartin82/repos","events_url":"https://api.github.com/users/almartin82/events{/privacy}","received_events_url":"https://api.github.com/users/almartin82/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/almartin82/mapvizieR","description":"","fork":false,"url":"https://api.github.com/repos/almartin82/mapvizieR","forks_url":"https://api.github.com/repos/almartin82/mapvizieR/forks","keys_url":"https://api.github.com/repos/almartin82/mapvizieR/keys{/key_id}","collaborators_url":"https://api.github.com/repos/almartin82/mapvizieR/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/almartin82/mapvizieR/teams","hooks_url":"https://api.github.com/repos/almartin82/mapvizieR/hooks","issue_events_url":"https://api.github.com/repos/almartin82/mapvizieR/issues/events{/number}","events_url":"https://api.github.com/repos/almartin82/mapvizieR/events","assignees_url":"https://api.github.com/repos/almartin82/mapvizieR/assignees{/user}","branches_url":"https://api.github.com/repos/almartin82/mapvizieR/branches{/branch}","tags_url":"https://api.github.com/repos/almartin82/mapvizieR/tags","blobs_url":"https://api.github.com/repos/almartin82/mapvizieR/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/almartin82/mapvizieR/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/almartin82/mapvizieR/git/refs{/sha}","trees_url":"https://api.github.com/repos/almartin82/mapvizieR/git/trees{/sha}","statuses_url":"https://api.github.com/repos/almartin82/mapvizieR/statuses/{sha}","languages_url":"https://api.github.com/repos/almartin82/mapvizieR/languages","stargazers_url":"https://api.github.com/repos/almartin82/mapvizieR/stargazers","contributors_url":"https://api.github.com/repos/almartin82/mapvizieR/contributors","subscribers_url":"https://api.github.com/repos/almartin82/mapvizieR/subscribers","subscription_url":"https://api.github.com/repos/almartin82/mapvizieR/subscription","commits_url":"https://api.github.com/repos/almartin82/mapvizieR/commits{/sha}","git_commits_url":"https://api.github.com/repos/almartin82/mapvizieR/git/commits{/sha}","comments_url":"https://api.github.com/repos/almartin82/mapvizieR/comments{/number}","issue_comment_url":"https://api.github.com/repos/almartin82/mapvizieR/issues/comments{/number}","contents_url":"https://api.github.com/repos/almartin82/mapvizieR/contents/{+path}","compare_url":"https://api.github.com/repos/almartin82/mapvizieR/compare/{base}...{head}","merges_url":"https://api.github.com/repos/almartin82/mapvizieR/merges","archive_url":"https://api.github.com/repos/almartin82/mapvizieR/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/almartin82/mapvizieR/downloads","issues_url":"https://api.github.com/repos/almartin82/mapvizieR/issues{/number}","pulls_url":"https://api.github.com/repos/almartin82/mapvizieR/pulls{/number}","milestones_url":"https://api.github.com/repos/almartin82/mapvizieR/milestones{/number}","notifications_url":"https://api.github.com/repos/almartin82/mapvizieR/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/almartin82/mapvizieR/labels{/name}","releases_url":"https://api.github.com/repos/almartin82/mapvizieR/releases{/id}","created_at":"2015-01-14T17:23:32Z","updated_at":"2015-05-28T21:24:14Z","pushed_at":"2015-06-05T19:41:10Z","git_url":"git://github.com/almartin82/mapvizieR.git","ssh_url":"git@github.com:almartin82/mapvizieR.git","clone_url":"https://github.com/almartin82/mapvizieR.git","svn_url":"https://github.com/almartin82/mapvizieR","homepage":null,"size":3503,"stargazers_count":3,"watchers_count":3,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":19,"forks":2,"open_issues":19,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/almartin82/mapvizieR/pulls/111"},"html":{"href":"https://github.com/almartin82/mapvizieR/pull/111"},"issue":{"href":"https://api.github.com/repos/almartin82/mapvizieR/issues/111"},"comments":{"href":"https://api.github.com/repos/almartin82/mapvizieR/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/almartin82/mapvizieR/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/almartin82/mapvizieR/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/almartin82/mapvizieR/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/almartin82/mapvizieR/statuses/ad352efa8117a14ff6592f9d63ab7d1b7088da99"}}}}