{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/ggplot2/issues/1270","labels_url":"https://api.github.com/repos/hadley/ggplot2/issues/1270/labels{/name}","comments_url":"https://api.github.com/repos/hadley/ggplot2/issues/1270/comments","events_url":"https://api.github.com/repos/hadley/ggplot2/issues/1270/events","html_url":"https://github.com/hadley/ggplot2/issues/1270","id":101488861,"number":1270,"title":"Failures when Hmisc is loaded","user":{"login":"kmillar","id":5491038,"avatar_url":"https://avatars.githubusercontent.com/u/5491038?v=3","gravatar_id":"","url":"https://api.github.com/users/kmillar","html_url":"https://github.com/kmillar","followers_url":"https://api.github.com/users/kmillar/followers","following_url":"https://api.github.com/users/kmillar/following{/other_user}","gists_url":"https://api.github.com/users/kmillar/gists{/gist_id}","starred_url":"https://api.github.com/users/kmillar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmillar/subscriptions","organizations_url":"https://api.github.com/users/kmillar/orgs","repos_url":"https://api.github.com/users/kmillar/repos","events_url":"https://api.github.com/users/kmillar/events{/privacy}","received_events_url":"https://api.github.com/users/kmillar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-17T19:01:35Z","updated_at":"2015-08-17T19:13:49Z","closed_at":"2015-08-17T19:13:49Z","body":"To reproduce, on R 3.2.x:\r\n````\r\nlibrary(ggplot2)\r\nlibrary(Hmisc)\r\ndata(mpg)\r\np <- qplot(mpg, wt, data = mtcars, colour = factor(cyl))\r\nh <-  p + scale_colour_manual(values = c(\"red\",\"blue\", \"green\"))\r\nstr(h)\r\n````\r\n\r\nThis fails with:\r\n````\r\n  .. .. ..$ range     :Classes 'manual', 'discrete', 'scale' Error in object[seq_len(ile)] : object of type 'S4' is not subsettable\r\nIn addition: Warning messages:\r\n1: In class(y) <- class(x) :\r\n  Setting class(x) to multiple strings (\"manual\", \"discrete\", ...); result will no longer be an S4 object\r\n2: In class(y) <- class(x) :\r\n  Setting class(x) to multiple strings (\"manual\", \"discrete\", ...); result will no longer be an S4 object\r\n````\r\n\r\nThe underlying issue here seems to be that both ggplot2 and Hmisc define a 'discrete' class, and the ggplot2 code is calling the methods built into Hmisc."},"comment":{"url":"https://api.github.com/repos/hadley/ggplot2/issues/comments/131933703","html_url":"https://github.com/hadley/ggplot2/issues/1270#issuecomment-131933703","issue_url":"https://api.github.com/repos/hadley/ggplot2/issues/1270","id":131933703,"user":{"login":"hadley","id":4196,"avatar_url":"https://avatars.githubusercontent.com/u/4196?v=3","gravatar_id":"","url":"https://api.github.com/users/hadley","html_url":"https://github.com/hadley","followers_url":"https://api.github.com/users/hadley/followers","following_url":"https://api.github.com/users/hadley/following{/other_user}","gists_url":"https://api.github.com/users/hadley/gists{/gist_id}","starred_url":"https://api.github.com/users/hadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadley/subscriptions","organizations_url":"https://api.github.com/users/hadley/orgs","repos_url":"https://api.github.com/users/hadley/repos","events_url":"https://api.github.com/users/hadley/events{/privacy}","received_events_url":"https://api.github.com/users/hadley/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T19:13:49Z","updated_at":"2015-08-17T19:13:49Z","body":"This works for me in the dev version, where I've done a lot of namespace tweaking.  (Also we've removed the proto dependency in favour of our own home grown implementation that's a bit more correct)"}}