{"action":"opened","issue":{"url":"https://api.github.com/repos/dankelley/oce/issues/892","repository_url":"https://api.github.com/repos/dankelley/oce","labels_url":"https://api.github.com/repos/dankelley/oce/issues/892/labels{/name}","comments_url":"https://api.github.com/repos/dankelley/oce/issues/892/comments","events_url":"https://api.github.com/repos/dankelley/oce/issues/892/events","html_url":"https://github.com/dankelley/oce/issues/892","id":141763706,"number":892,"title":"better handling of argo flags","user":{"login":"richardsc","id":233584,"avatar_url":"https://avatars.githubusercontent.com/u/233584?v=3","gravatar_id":"","url":"https://api.github.com/users/richardsc","html_url":"https://github.com/richardsc","followers_url":"https://api.github.com/users/richardsc/followers","following_url":"https://api.github.com/users/richardsc/following{/other_user}","gists_url":"https://api.github.com/users/richardsc/gists{/gist_id}","starred_url":"https://api.github.com/users/richardsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardsc/subscriptions","organizations_url":"https://api.github.com/users/richardsc/orgs","repos_url":"https://api.github.com/users/richardsc/repos","events_url":"https://api.github.com/users/richardsc/events{/privacy}","received_events_url":"https://api.github.com/users/richardsc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dankelley/oce/labels/argo","name":"argo","color":"bfd4f2"},{"url":"https://api.github.com/repos/dankelley/oce/labels/flags","name":"flags","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"richardsc","id":233584,"avatar_url":"https://avatars.githubusercontent.com/u/233584?v=3","gravatar_id":"","url":"https://api.github.com/users/richardsc","html_url":"https://github.com/richardsc","followers_url":"https://api.github.com/users/richardsc/followers","following_url":"https://api.github.com/users/richardsc/following{/other_user}","gists_url":"https://api.github.com/users/richardsc/gists{/gist_id}","starred_url":"https://api.github.com/users/richardsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardsc/subscriptions","organizations_url":"https://api.github.com/users/richardsc/orgs","repos_url":"https://api.github.com/users/richardsc/repos","events_url":"https://api.github.com/users/richardsc/events{/privacy}","received_events_url":"https://api.github.com/users/richardsc/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2016-03-18T03:22:31Z","updated_at":"2016-03-18T03:22:31Z","closed_at":null,"body":"Issue #829 made steps toward dealing with flagged data in `argo` objects, but as stated in the discussion there it is worth thinking about how to do more than just set all flagged data to NA. For example, with argo data, I might want to set all `flag==3` and `flag==4` data to NA, but not 1 or 2.\r\n\r\nOne way to do this was suggested in #829, was to provide a `key` argument, like:\r\n```r\r\nhandleFlags(x, key=list(bad=c(4, NA), good=1)) # keep only data known to be good\r\nhandleFlags(x, key=list(bad=c(4, NA), good=c(0,1))) # also keep the un-QC'd data\r\n```\r\n\r\nAnother way would be for `handleFlags()` to have an arg for flag type and replacement, like:\r\n```r\r\nhandleFlags(x, flag=4, replace=NA) # replace 4 with NA\r\nhandleFlags(x, flag=c(3, 4, NA), replace=NA) # replace flag 3, 4 and NA with NA\r\n```\r\nI suppose it's possible that the `replace` arg could be a function, though it's not obvious to me if that would be useful or not.\r\n\r\nOn a related point, for an `argo` object currently the flags are saved as characters in a matrix. Does it make sense for that to be converted to numeric at read time, for easier comparison and plotting?"}}