{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/ggplot2/issues/1428","labels_url":"https://api.github.com/repos/hadley/ggplot2/issues/1428/labels{/name}","comments_url":"https://api.github.com/repos/hadley/ggplot2/issues/1428/comments","events_url":"https://api.github.com/repos/hadley/ggplot2/issues/1428/events","html_url":"https://github.com/hadley/ggplot2/issues/1428","id":121801502,"number":1428,"title":"`position_nudge` doesn't work when called as `position = \"nudge\"`","user":{"login":"garrettgman","id":85014,"avatar_url":"https://avatars.githubusercontent.com/u/85014?v=3","gravatar_id":"","url":"https://api.github.com/users/garrettgman","html_url":"https://github.com/garrettgman","followers_url":"https://api.github.com/users/garrettgman/followers","following_url":"https://api.github.com/users/garrettgman/following{/other_user}","gists_url":"https://api.github.com/users/garrettgman/gists{/gist_id}","starred_url":"https://api.github.com/users/garrettgman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garrettgman/subscriptions","organizations_url":"https://api.github.com/users/garrettgman/orgs","repos_url":"https://api.github.com/users/garrettgman/repos","events_url":"https://api.github.com/users/garrettgman/events{/privacy}","received_events_url":"https://api.github.com/users/garrettgman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-11T22:07:22Z","updated_at":"2015-12-15T14:45:58Z","closed_at":"2015-12-12T12:41:27Z","body":"Here's the example from `?position_nudge`, which works.\r\n\r\n````\r\ndf <- data.frame(\r\n  x = c(1,3,2,5),\r\n  y = c(\"a\",\"c\",\"d\",\"c\")\r\n)\r\n\r\nggplot(df, aes(x, y)) +\r\n  geom_point() +\r\n  geom_text(aes(label = y))\r\n\r\nggplot(df, aes(x, y)) +\r\n  geom_point() +\r\n  geom_text(aes(label = y), position = position_nudge(y = -0.1))\r\n````\r\n\r\nBut the code breaks when you call `position = \"nudge\"`, as you might do with other positions. \r\n\r\n````\r\nggplot(df, aes(x, y)) +\r\n  geom_point() +\r\n  geom_text(aes(label = y), position = \"nudge\")\r\n````\r\n\r\nThere's no warning message, the text layer just disappears.\r\n\r\nThis is bad for me because I'd prefer to be able to teach beginners all five position adjustments without having to teach them the `position = position_nudge()` syntax. The second syntax is a bit overwhelming for someone new to R since it contains a function inside an argument. (We begin new R students with `ggplot2` because visualizations are cool.)"},"comment":{"url":"https://api.github.com/repos/hadley/ggplot2/issues/comments/164784908","html_url":"https://github.com/hadley/ggplot2/issues/1428#issuecomment-164784908","issue_url":"https://api.github.com/repos/hadley/ggplot2/issues/1428","id":164784908,"user":{"login":"garrettgman","id":85014,"avatar_url":"https://avatars.githubusercontent.com/u/85014?v=3","gravatar_id":"","url":"https://api.github.com/users/garrettgman","html_url":"https://github.com/garrettgman","followers_url":"https://api.github.com/users/garrettgman/followers","following_url":"https://api.github.com/users/garrettgman/following{/other_user}","gists_url":"https://api.github.com/users/garrettgman/gists{/gist_id}","starred_url":"https://api.github.com/users/garrettgman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garrettgman/subscriptions","organizations_url":"https://api.github.com/users/garrettgman/orgs","repos_url":"https://api.github.com/users/garrettgman/repos","events_url":"https://api.github.com/users/garrettgman/events{/privacy}","received_events_url":"https://api.github.com/users/garrettgman/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T14:45:58Z","updated_at":"2015-12-15T14:45:58Z","body":"@has2k1 your argument is defensible. I think it depends on how far you want to stray from Leland's grammar which called position adjustments \"collision modifiers.\" Leland's grammar can certainly be improved upon; it didn't have layers for example. This may be one of those improvements.\r\n\r\nHowever, `position = \"nudge\"` still fails with no error message (it silently removes the text geom from the plot), which makes me feel that this issue is not completely resolved."}}