{"action":"closed","issue":{"url":"https://api.github.com/repos/tidyverse/ggplot2/issues/2373","repository_url":"https://api.github.com/repos/tidyverse/ggplot2","labels_url":"https://api.github.com/repos/tidyverse/ggplot2/issues/2373/labels{/name}","comments_url":"https://api.github.com/repos/tidyverse/ggplot2/issues/2373/comments","events_url":"https://api.github.com/repos/tidyverse/ggplot2/issues/2373/events","html_url":"https://github.com/tidyverse/ggplot2/issues/2373","id":282387420,"number":2373,"title":"very long geom_bar computation time with iso-8859-1 encoded character in aes fill","user":{"login":"dirkschumacher","id":1569647,"avatar_url":"https://avatars2.githubusercontent.com/u/1569647?v=4","gravatar_id":"","url":"https://api.github.com/users/dirkschumacher","html_url":"https://github.com/dirkschumacher","followers_url":"https://api.github.com/users/dirkschumacher/followers","following_url":"https://api.github.com/users/dirkschumacher/following{/other_user}","gists_url":"https://api.github.com/users/dirkschumacher/gists{/gist_id}","starred_url":"https://api.github.com/users/dirkschumacher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirkschumacher/subscriptions","organizations_url":"https://api.github.com/users/dirkschumacher/orgs","repos_url":"https://api.github.com/users/dirkschumacher/repos","events_url":"https://api.github.com/users/dirkschumacher/events{/privacy}","received_events_url":"https://api.github.com/users/dirkschumacher/received_events","type":"User","site_admin":false},"labels":[{"id":17279,"url":"https://api.github.com/repos/tidyverse/ggplot2/labels/bug","name":"bug","color":"e02a2a","default":true},{"id":914900951,"url":"https://api.github.com/repos/tidyverse/ggplot2/labels/help%20wanted","name":"help wanted","color":"008672","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-12-15T10:43:17Z","updated_at":"2018-05-19T00:33:42Z","closed_at":"2018-05-19T00:33:42Z","author_association":"NONE","body":"While reading in an `ISO-8859-1` encoded csv file, I noticed a strange behaviour when plotting certain columns as a bar plot. `geom_bar` enters an infinte loop (or at least takes unreasonaby long to compute) if the column used for `fill` in `aes_string` ends with a special character (German Umlaut).\r\n\r\nTakes forever:\r\n```r\r\nlibrary(ggplot2)\r\ndata <- data.frame(\r\n  a = \"a\",\r\n  b = iconv(\"Some_prefix_ä\", \"utf8\", \"iso-8859-1\")\r\n)\r\nggplot(data) +\r\n  geom_bar(aes_string(\"a\", fill = \"b\"))\r\n```\r\n\r\nWorks as expected:\r\n```r\r\nlibrary(ggplot2)\r\ndata <- data.frame(\r\n  a = \"a\",\r\n  b = iconv(\"ä\", \"utf8\", \"iso-8859-1\")\r\n)\r\nggplot(data) +\r\n  geom_bar(aes_string(\"a\", fill = \"b\"))\r\n```\r\n\r\nAlso this works as expected (seems the length of the prefix must be greater than 1):\r\n```r\r\nlibrary(ggplot2)\r\ndata <- data.frame(\r\n  a = \"a\",\r\n  b = iconv(\"aä\", \"utf8\", \"iso-8859-1\")\r\n)\r\nggplot(data) +\r\n  geom_bar(aes_string(\"a\", fill = \"b\"))\r\n```\r\n\r\nTested on a mac with R `3.4.2` and observed on a ubuntu shiny server with the same R version. Used ggplot2 `v2.2.1`"}}
{"actor":{"display_login":"hadley"}}