{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/haven/issues/93","labels_url":"https://api.github.com/repos/hadley/haven/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/hadley/haven/issues/93/comments","events_url":"https://api.github.com/repos/hadley/haven/issues/93/events","html_url":"https://github.com/hadley/haven/issues/93","id":97111226,"number":93,"title":"as_factor.labelled fails after importing spss file","user":{"login":"gergness","id":2104579,"avatar_url":"https://avatars.githubusercontent.com/u/2104579?v=3","gravatar_id":"","url":"https://api.github.com/users/gergness","html_url":"https://github.com/gergness","followers_url":"https://api.github.com/users/gergness/followers","following_url":"https://api.github.com/users/gergness/following{/other_user}","gists_url":"https://api.github.com/users/gergness/gists{/gist_id}","starred_url":"https://api.github.com/users/gergness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gergness/subscriptions","organizations_url":"https://api.github.com/users/gergness/orgs","repos_url":"https://api.github.com/users/gergness/repos","events_url":"https://api.github.com/users/gergness/events{/privacy}","received_events_url":"https://api.github.com/users/gergness/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-24T18:34:19Z","updated_at":"2015-09-09T19:54:18Z","closed_at":null,"body":"This is likely related to #91, but it doesn't seem like the labelled values are being imported from SPSS correctly after the new is_na changes. \r\n\r\n    library(haven)\r\n    df <- read_spss(\"http://calcnet.mth.cmich.edu/org/spss/V16_materials/DataSets_v16/NewDrug.sav\")\r\n\r\n    as_factor(df$Treatment)\r\n    # Error in !attr(df$Treatment, \"is_na\") : invalid argument type\r\n    attr(df$Treatment, \"is_na\")\r\n    # NULL\r\n    \r\n    as_factor(df$Treatment[])\r\n    # works\r\n     attr(df$Treatment[], \"is_na\")\r\n     # also as expected\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/hadley/haven/issues/comments/139027499","html_url":"https://github.com/hadley/haven/issues/93#issuecomment-139027499","issue_url":"https://api.github.com/repos/hadley/haven/issues/93","id":139027499,"user":{"login":"gergness","id":2104579,"avatar_url":"https://avatars.githubusercontent.com/u/2104579?v=3","gravatar_id":"","url":"https://api.github.com/users/gergness","html_url":"https://github.com/gergness","followers_url":"https://api.github.com/users/gergness/followers","following_url":"https://api.github.com/users/gergness/following{/other_user}","gists_url":"https://api.github.com/users/gergness/gists{/gist_id}","starred_url":"https://api.github.com/users/gergness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gergness/subscriptions","organizations_url":"https://api.github.com/users/gergness/orgs","repos_url":"https://api.github.com/users/gergness/repos","events_url":"https://api.github.com/users/gergness/events{/privacy}","received_events_url":"https://api.github.com/users/gergness/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T19:54:18Z","updated_at":"2015-09-09T19:54:18Z","body":"yep, tests work okay\r\n\r\n```\r\n==> devtools::test()\r\n\r\nLoading haven\r\nTesting haven\r\nLabelled : .........\r\nread_sas : ............\r\nread_sav : .........\r\nread_stata : .\r\nwrite : ..................\r\n\r\nDONE \r\nWarning message:\r\npackage 'testthat' was built under R version 3.2.2 \r\n```"}}