{"action":"created","issue":{"url":"https://api.github.com/repos/sjPlot/sjmisc/issues/42","repository_url":"https://api.github.com/repos/sjPlot/sjmisc","labels_url":"https://api.github.com/repos/sjPlot/sjmisc/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/sjPlot/sjmisc/issues/42/comments","events_url":"https://api.github.com/repos/sjPlot/sjmisc/issues/42/events","html_url":"https://github.com/sjPlot/sjmisc/issues/42","id":196221960,"number":42,"title":"drop_labels()","user":{"login":"methodds","id":7460499,"avatar_url":"https://avatars.githubusercontent.com/u/7460499?v=3","gravatar_id":"","url":"https://api.github.com/users/methodds","html_url":"https://github.com/methodds","followers_url":"https://api.github.com/users/methodds/followers","following_url":"https://api.github.com/users/methodds/following{/other_user}","gists_url":"https://api.github.com/users/methodds/gists{/gist_id}","starred_url":"https://api.github.com/users/methodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/methodds/subscriptions","organizations_url":"https://api.github.com/users/methodds/orgs","repos_url":"https://api.github.com/users/methodds/repos","events_url":"https://api.github.com/users/methodds/events{/privacy}","received_events_url":"https://api.github.com/users/methodds/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-12-17T13:24:59Z","updated_at":"2016-12-22T10:46:19Z","closed_at":"2016-12-17T18:42:57Z","body":"Hi,\r\n\r\nI guess it's a matter of design philosophy as well, but I would like to suggest calling ``drop_labels()``as default for functions like ```sjt.tab()```, and/or let ``set_na()``optionally drop unused labels as well.\r\nOften variables are just copied while encoding missing values like so:\r\n\r\n````\r\nd <- read_stata('GLES_Vorwahlquerschnitt_ZA5700_v1-0-0.dta')\r\nvars <- select(d, q41, q119a, q192, q11ba) %>% set_na(-99:-83)\r\nsjt.xtab(vars$q41, vars$q11ba) # gets messed up without drop_labels()\r\n````\r\nIt is only a small detail, but I dislike the need to call ``drop_labels()`` in such cases again for dropping any unused NA labels. If one does not use ``drop_labels()``, outputs for ``sjt.xtab()`` etc. get ugly because of the 0 categories for unused labels.\r\n\r\nI guess this all comes down to one question for the whole package: Do you ever need unused labels for most analysis again? I personally don't, but maybe this is different for other people."},"comment":{"url":"https://api.github.com/repos/sjPlot/sjmisc/issues/comments/268774183","html_url":"https://github.com/sjPlot/sjmisc/issues/42#issuecomment-268774183","issue_url":"https://api.github.com/repos/sjPlot/sjmisc/issues/42","id":268774183,"user":{"login":"sjPlot","id":4901179,"avatar_url":"https://avatars.githubusercontent.com/u/4901179?v=3","gravatar_id":"","url":"https://api.github.com/users/sjPlot","html_url":"https://github.com/sjPlot","followers_url":"https://api.github.com/users/sjPlot/followers","following_url":"https://api.github.com/users/sjPlot/following{/other_user}","gists_url":"https://api.github.com/users/sjPlot/gists{/gist_id}","starred_url":"https://api.github.com/users/sjPlot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjPlot/subscriptions","organizations_url":"https://api.github.com/users/sjPlot/orgs","repos_url":"https://api.github.com/users/sjPlot/repos","events_url":"https://api.github.com/users/sjPlot/events{/privacy}","received_events_url":"https://api.github.com/users/sjPlot/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T10:46:19Z","updated_at":"2016-12-22T10:46:19Z","body":"I have posted an \"example workflow\" in my blog, maybe this is helpful, too:\r\nhttps://strengejacke.wordpress.com/2016/12/22/exploring-the-european-social-survey-ess-pipe-friendly-workflow-with-sjmisc-part-2-rstats-tidyverse/"}}
{"actor":{"display_login":"sjPlot"}}