{"action":"created","issue":{"url":"https://api.github.com/repos/cvitolo/rnrfa/issues/12","repository_url":"https://api.github.com/repos/cvitolo/rnrfa","labels_url":"https://api.github.com/repos/cvitolo/rnrfa/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/cvitolo/rnrfa/issues/12/comments","events_url":"https://api.github.com/repos/cvitolo/rnrfa/issues/12/events","html_url":"https://github.com/cvitolo/rnrfa/issues/12","id":331320004,"node_id":"MDU6SXNzdWUzMzEzMjAwMDQ=","number":12,"title":"lowercase grid letters error \" subscript out of bounds\"","user":{"login":"bogsnork","id":23337510,"node_id":"MDQ6VXNlcjIzMzM3NTEw","avatar_url":"https://avatars3.githubusercontent.com/u/23337510?v=4","gravatar_id":"","url":"https://api.github.com/users/bogsnork","html_url":"https://github.com/bogsnork","followers_url":"https://api.github.com/users/bogsnork/followers","following_url":"https://api.github.com/users/bogsnork/following{/other_user}","gists_url":"https://api.github.com/users/bogsnork/gists{/gist_id}","starred_url":"https://api.github.com/users/bogsnork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bogsnork/subscriptions","organizations_url":"https://api.github.com/users/bogsnork/orgs","repos_url":"https://api.github.com/users/bogsnork/repos","events_url":"https://api.github.com/users/bogsnork/events{/privacy}","received_events_url":"https://api.github.com/users/bogsnork/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-11T19:31:56Z","updated_at":"2018-06-12T09:31:41Z","closed_at":null,"author_association":"NONE","body":"https://github.com/cvitolo/rnrfa/blob/d097be3a2582b641ff55ae4ac5d7b6b9afed96e2/R/osg_parse.R#L54\r\n\r\nI've been using your osg_parse function (which is great) on large numbers of OS grid references.  One of my files returned the following error:\r\n```r\r\n#> Error in offset1[letter[, 1], , drop = FALSE]: subscript out of bounds\r\n```\r\nI tracked it down to a few lowercase grid letters and managed to fix it by making the grid reference vector uppercase with `toupper()`.  Would be great if you could incorporate that into the function.  Example below: \r\n``` r\r\n# sample grid refs with a lowercase grid letter\r\ndata <- c(\"ST555780\", \"sT45\", \"ST28\", \"ST5566\", \"ST45\", \"ST43236136\")\r\n\r\n#generate eastings and northings\r\nrnrfa::osg_parse(gridRefs = data)\r\n#> Error in offset1[letter[, 1], , drop = FALSE]: subscript out of bounds\r\n```\r\nExample with fix: \r\n```r\r\n# sample grid refs with a lowercase grid letter\r\ndata <- c(\"ST555780\", \"sT45\", \"ST28\", \"ST5566\", \"ST45\", \"ST43236136\")\r\n\r\n# convert to uppercase\r\ndata <- toupper(data)\r\n\r\n#generate eastings and northings\r\nrnrfa::osg_parse(gridRefs = data)\r\n#> $easting\r\n#> [1] 355500 340000 320000 355000 340000 343230\r\n#> \r\n#> $northing\r\n#> [1] 178000 150000 180000 166000 150000 161360\r\n```\r\n\r\np.s. this is my first ever issue on someone else's repository!"},"comment":{"url":"https://api.github.com/repos/cvitolo/rnrfa/issues/comments/396527600","html_url":"https://github.com/cvitolo/rnrfa/issues/12#issuecomment-396527600","issue_url":"https://api.github.com/repos/cvitolo/rnrfa/issues/12","id":396527600,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjUyNzYwMA==","user":{"login":"BeckyTrippier","id":38854647,"node_id":"MDQ6VXNlcjM4ODU0NjQ3","avatar_url":"https://avatars0.githubusercontent.com/u/38854647?v=4","gravatar_id":"","url":"https://api.github.com/users/BeckyTrippier","html_url":"https://github.com/BeckyTrippier","followers_url":"https://api.github.com/users/BeckyTrippier/followers","following_url":"https://api.github.com/users/BeckyTrippier/following{/other_user}","gists_url":"https://api.github.com/users/BeckyTrippier/gists{/gist_id}","starred_url":"https://api.github.com/users/BeckyTrippier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BeckyTrippier/subscriptions","organizations_url":"https://api.github.com/users/BeckyTrippier/orgs","repos_url":"https://api.github.com/users/BeckyTrippier/repos","events_url":"https://api.github.com/users/BeckyTrippier/events{/privacy}","received_events_url":"https://api.github.com/users/BeckyTrippier/received_events","type":"User","site_admin":false},"created_at":"2018-06-12T09:31:41Z","updated_at":"2018-06-12T09:31:41Z","author_association":"NONE","body":"Thank you for raising this! I have now updated the script to fix this so it should be able to handle a mixture of upper and lower case letters in \"OSGR\".  Best wishes, Becky."}}
{"actor":{"display_login":"BeckyTrippier"}}