{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/dplyr/issues/951","labels_url":"https://api.github.com/repos/hadley/dplyr/issues/951/labels{/name}","comments_url":"https://api.github.com/repos/hadley/dplyr/issues/951/comments","events_url":"https://api.github.com/repos/hadley/dplyr/issues/951/events","html_url":"https://github.com/hadley/dplyr/issues/951","id":56918445,"number":951,"title":"UTF-8 problems with summarise_each, other dplyr verbs OK ","user":{"login":"andrewdolman","id":787647,"avatar_url":"https://avatars.githubusercontent.com/u/787647?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewdolman","html_url":"https://github.com/andrewdolman","followers_url":"https://api.github.com/users/andrewdolman/followers","following_url":"https://api.github.com/users/andrewdolman/following{/other_user}","gists_url":"https://api.github.com/users/andrewdolman/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewdolman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewdolman/subscriptions","organizations_url":"https://api.github.com/users/andrewdolman/orgs","repos_url":"https://api.github.com/users/andrewdolman/repos","events_url":"https://api.github.com/users/andrewdolman/events{/privacy}","received_events_url":"https://api.github.com/users/andrewdolman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-07T17:26:16Z","updated_at":"2015-03-16T11:37:46Z","closed_at":null,"body":"Loving dplyr but came across this issue this morning. It seems to have cropped up a few times before and has been mostly fixed, but is still an issue with summarise_each\r\n\r\nThe problem is with non standard characters in dataframe column names, e.g. µ or ä.\r\n\r\nAfter manipulation with summarise_each() names with these characters have extra characters.\r\n\r\nProblem occurs on Windows (have not checked other setups) when names are encoded as UTF-8.\r\n\r\nWhen I first came across this problem I was using dplyr version 0.3.x - all \"verbs\" cased the problem. After updating to dplyr 0.4.1 the problem was fixed for most dplyr \"verbs\", but summarise_each still gives me the same issue.\r\n\r\n```\r\n## Reproducable example\r\nlibrary(dplyr)\r\n\r\ndf <- data.frame(Month = c(month.abb[1:3], \"März\"), a = 1:4, ä = 1:4, b=1:4, µ=1:4)\r\ndf\r\n\r\n### This works\r\nEncoding(names(df))\r\ndf %>% summarise_each(funs(mean)) -> df2\r\ndf2\r\nEncoding(names(df2))\r\n\r\n### This does not\r\n#### Set encoding of names to UTF-8\r\nnames(df) <- enc2utf8(names(df))\r\nEncoding(names(df))\r\ndf %>% summarise_each(funs(mean)) -> df2\r\ndf2\r\nEncoding(names(df2))\r\n\r\n\r\n### Encoding to native works\r\nnames(df) <- enc2native(names(df))\r\nEncoding(names(df))\r\ndf %>% summarise_each(funs(mean)) -> df2\r\ndf2\r\nEncoding(names(df2))\r\n\r\n```\r\n## sessionInfo\r\nR version 3.1.2 (2014-10-31)\r\nPlatform: x86_64-w64-mingw32/x64 (64-bit)\r\n\r\nlocale:\r\n[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252    LC_MONETARY=English_United Kingdom.1252\r\n[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    \r\n\r\nattached base packages:\r\n[1] stats     graphics  grDevices utils     datasets  methods   base     \r\n\r\nother attached packages:\r\n[1] dplyr_0.4.1\r\n\r\nloaded via a namespace (and not attached):\r\n[1] assertthat_0.1  DBI_0.3.1       lazyeval_0.1.10 magrittr_1.5    parallel_3.1.2  Rcpp_0.11.4     tools_3.1.2    \r\n"},"comment":{"url":"https://api.github.com/repos/hadley/dplyr/issues/comments/81594875","html_url":"https://github.com/hadley/dplyr/issues/951#issuecomment-81594875","issue_url":"https://api.github.com/repos/hadley/dplyr/issues/951","id":81594875,"user":{"login":"andrewdolman","id":787647,"avatar_url":"https://avatars.githubusercontent.com/u/787647?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewdolman","html_url":"https://github.com/andrewdolman","followers_url":"https://api.github.com/users/andrewdolman/followers","following_url":"https://api.github.com/users/andrewdolman/following{/other_user}","gists_url":"https://api.github.com/users/andrewdolman/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewdolman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewdolman/subscriptions","organizations_url":"https://api.github.com/users/andrewdolman/orgs","repos_url":"https://api.github.com/users/andrewdolman/repos","events_url":"https://api.github.com/users/andrewdolman/events{/privacy}","received_events_url":"https://api.github.com/users/andrewdolman/received_events","type":"User","site_admin":false},"created_at":"2015-03-16T11:37:46Z","updated_at":"2015-03-16T11:37:46Z","body":"backticks employed"}}