{"action":"created","issue":{"url":"https://api.github.com/repos/almartin82/mapvizieR/issues/34","labels_url":"https://api.github.com/repos/almartin82/mapvizieR/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/almartin82/mapvizieR/issues/34/comments","events_url":"https://api.github.com/repos/almartin82/mapvizieR/issues/34/events","html_url":"https://github.com/almartin82/mapvizieR/issues/34","id":55948805,"number":34,"title":"is.ggplot() is not a useful test","user":{"login":"almartin82","id":782135,"avatar_url":"https://avatars.githubusercontent.com/u/782135?v=3","gravatar_id":"","url":"https://api.github.com/users/almartin82","html_url":"https://github.com/almartin82","followers_url":"https://api.github.com/users/almartin82/followers","following_url":"https://api.github.com/users/almartin82/following{/other_user}","gists_url":"https://api.github.com/users/almartin82/gists{/gist_id}","starred_url":"https://api.github.com/users/almartin82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almartin82/subscriptions","organizations_url":"https://api.github.com/users/almartin82/orgs","repos_url":"https://api.github.com/users/almartin82/repos","events_url":"https://api.github.com/users/almartin82/events{/privacy}","received_events_url":"https://api.github.com/users/almartin82/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/almartin82/mapvizieR/labels/task","name":"task","color":"5319e7"}],"state":"open","locked":false,"assignee":{"login":"chrishaid","id":974079,"avatar_url":"https://avatars.githubusercontent.com/u/974079?v=3","gravatar_id":"","url":"https://api.github.com/users/chrishaid","html_url":"https://github.com/chrishaid","followers_url":"https://api.github.com/users/chrishaid/followers","following_url":"https://api.github.com/users/chrishaid/following{/other_user}","gists_url":"https://api.github.com/users/chrishaid/gists{/gist_id}","starred_url":"https://api.github.com/users/chrishaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrishaid/subscriptions","organizations_url":"https://api.github.com/users/chrishaid/orgs","repos_url":"https://api.github.com/users/chrishaid/repos","events_url":"https://api.github.com/users/chrishaid/events{/privacy}","received_events_url":"https://api.github.com/users/chrishaid/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-01-29T20:00:54Z","updated_at":"2015-01-30T21:15:21Z","closed_at":null,"body":"I think this because of the weak class system in S3? in any case `is.ggplot()` doesn't ensure that you have a valid ggplot object  let me illustrate:\r\n\r\n```\r\nlibrary(ggplot2)\r\n\r\np <- ggplot(\r\n  data=diamonds\r\n ,aes(\r\n    x=carat\r\n   ,y=price\r\n  )\r\n) +\r\ngeom_point() +\r\ntheme_bw()\r\n\r\nis.ggplot(p)\r\n# returns TRUE\r\n\r\n\r\np2 <- ggplot(\r\n  data=diamonds\r\n ,aes(\r\n    x=broken\r\n   ,y=broken\r\n  )\r\n) +\r\ngeom_point() +\r\ntheme_bw()\r\n\r\nis.ggplot(p2)\r\n#also returns TRUE!\r\n\r\np2\r\n#returns Error in eval(expr, envir, enclos) : object 'broken' not found \r\n```\r\n\r\nright.  i think `ggplot_build()` is an alternative; take a look at [this commit](https://github.com/almartin82/mapvizieR/blob/8c4e25e95bed76f1eff4f8d0b093f8439e9f0c8f/R/fuzz_test.R#L39) where I examine the structure of the list object that comes back from ggplot_build and look for certain names (that I think are generic to all ggplot objects?  not sure about that, though).\r\n\r\nI think this means we need to go through and strip out our `is.ggplot()` calls in tests?"},"comment":{"url":"https://api.github.com/repos/almartin82/mapvizieR/issues/comments/72271495","html_url":"https://github.com/almartin82/mapvizieR/issues/34#issuecomment-72271495","issue_url":"https://api.github.com/repos/almartin82/mapvizieR/issues/34","id":72271495,"user":{"login":"almartin82","id":782135,"avatar_url":"https://avatars.githubusercontent.com/u/782135?v=3","gravatar_id":"","url":"https://api.github.com/users/almartin82","html_url":"https://github.com/almartin82","followers_url":"https://api.github.com/users/almartin82/followers","following_url":"https://api.github.com/users/almartin82/following{/other_user}","gists_url":"https://api.github.com/users/almartin82/gists{/gist_id}","starred_url":"https://api.github.com/users/almartin82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almartin82/subscriptions","organizations_url":"https://api.github.com/users/almartin82/orgs","repos_url":"https://api.github.com/users/almartin82/repos","events_url":"https://api.github.com/users/almartin82/events{/privacy}","received_events_url":"https://api.github.com/users/almartin82/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T21:15:21Z","updated_at":"2015-01-30T21:15:21Z","body":"I think i had to ķill those because elephants has to do some munging on\r\nterms (geom_density needs at least 3 observations) and as a consequence the\r\ninput length and output length weren't always the same.\r\nOn Jan 30, 2015 4:10 PM, \"Chris Haid\" <notifications@github.com> wrote:\r\n\r\n> For sure. I wrote a set of tests last week on a gg_build. They must have\r\n> gotten blown out at some point during a merge. I think the key data live in\r\n> the plot section of the build object.\r\n>\r\n> —\r\n> Reply to this email directly or view it on GitHub\r\n> <https://github.com/almartin82/mapvizieR/issues/34#issuecomment-72270852>.\r\n>"}}