{"action":"created","issue":{"url":"https://api.github.com/repos/nicholasehamilton/ggtern/issues/21","labels_url":"https://api.github.com/repos/nicholasehamilton/ggtern/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/nicholasehamilton/ggtern/issues/21/comments","events_url":"https://api.github.com/repos/nicholasehamilton/ggtern/issues/21/events","html_url":"https://github.com/nicholasehamilton/ggtern/issues/21","id":80907071,"number":21,"title":"Conflict with ggplot ","user":{"login":"gilleschapron","id":10176335,"avatar_url":"https://avatars.githubusercontent.com/u/10176335?v=3","gravatar_id":"","url":"https://api.github.com/users/gilleschapron","html_url":"https://github.com/gilleschapron","followers_url":"https://api.github.com/users/gilleschapron/followers","following_url":"https://api.github.com/users/gilleschapron/following{/other_user}","gists_url":"https://api.github.com/users/gilleschapron/gists{/gist_id}","starred_url":"https://api.github.com/users/gilleschapron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilleschapron/subscriptions","organizations_url":"https://api.github.com/users/gilleschapron/orgs","repos_url":"https://api.github.com/users/gilleschapron/repos","events_url":"https://api.github.com/users/gilleschapron/events{/privacy}","received_events_url":"https://api.github.com/users/gilleschapron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-26T10:47:19Z","updated_at":"2015-08-07T08:52:17Z","closed_at":null,"body":"Hi Nicolas,\r\n\r\nIn fact, this is not an issue of your package, but perhaps, you could give me some advice.\r\n\r\nI have create a function that use your package in my one 'private' package.\r\nMy package intensively use ggplot2 in many function, so I use \r\n> @import ggplot2 \r\n\r\nto globaly import it.\r\n\r\nI first do the same thing with ggtern : \r\n> @import ggtern\r\n\r\nwith consequence that my function that create the ternary plot work perfectly. But other function that use only ggplot2 consequently do not anymore...\r\nI have some \r\n> object of type 'closure' is not subsettable\r\n\r\nerror that I have not if I do not build my function using ggtern in my package.\r\n\r\nSo, a thing that could I suppose solve the problem is to stop using @import ggtern in my function and to call all the specific ggtern function with \"ggtern::\".\r\n\r\nI have tried to to do so in the following code (sorry its not reproductible, but I can give you my all code if necessary):\r\n```r\r\n  plot.demol <- ggplot() + ggtern::coord_tern() +\r\n    ggtern::geom_segment(data = lim.demolon,\r\n                 ggtern::aes(x = y, y = x, z = z,\r\n                     xend = yend, yend = xend, zend = zend),\r\n                 size = 0.5) +\r\n    geom_text(data = type.sol, ggtern::aes(x = L, y = T, z = R, label = txt),\r\n              size = 2.5, lineheight = 0.75) +\r\n    geom_point(data = granu,\r\n               mapping = ggtern::aes(y = T, x = L, z = R, shape = sect),\r\n               colour = formcoul, fill = formcoul, size = 2) +\r\n    ggtern::scale_T_continuous(name = expression(\"Argile (< \"*2*\" µm)\")) +\r\n    ggtern::scale_L_continuous(name = expression(\"Limon (\"*2*\" à \"*20*\" µm)\")) +\r\n    ggtern::scale_R_continuous(name = expression(\"Sable (> \"*20*\" µm)\")) +\r\n    ggtern::theme_showarrows() +\r\n    ggtern::theme_arrowlong() +\r\n    ggtern::theme_hidetitles() +\r\n    ggtitle(element_blank()) +\r\n    ggtern::theme(axis.tern.title = element_text(size = 8, face = \"bold\"),\r\n          axis.tern.text = element_text(size = 7),\r\n          legend.title = element_blank(),\r\n          legend.text = element_text(size = 6),\r\n          legend.background = element_blank(),\r\n          legend.key = element_blank(),\r\n          legend.direction = \"horizontal\",\r\n          legend.position = c(0.5, 1),\r\n          legend.justification = c(0.5, 0.35),\r\n          plot.margin= ggtern::unit(c(0.05, 0, 0, 0), \"null\")) +\r\n    scale_shape_manual(values = sect_concerne[[3]],\r\n                       breaks = sect_concerne[[1]])\r\n```\r\nInfortunately I have the error that come I think from ggplot2 that do not interpret a function:\r\n> Error in UseMethod(\"scale_clone\") : \r\n> no applicable method for 'scale_clone' applied to an object of class \"c('tern_T', \r\n> 'continuous_ternary', 'scale')\"\r\n\r\nCould you have any idea to help me about it ?\r\nMy apologies if I'm not in the best place to ask my question...\r\n\r\nRegards,\r\nGilles"},"comment":{"url":"https://api.github.com/repos/nicholasehamilton/ggtern/issues/comments/128644337","html_url":"https://github.com/nicholasehamilton/ggtern/issues/21#issuecomment-128644337","issue_url":"https://api.github.com/repos/nicholasehamilton/ggtern/issues/21","id":128644337,"user":{"login":"nicholasehamilton","id":4231719,"avatar_url":"https://avatars.githubusercontent.com/u/4231719?v=3","gravatar_id":"","url":"https://api.github.com/users/nicholasehamilton","html_url":"https://github.com/nicholasehamilton","followers_url":"https://api.github.com/users/nicholasehamilton/followers","following_url":"https://api.github.com/users/nicholasehamilton/following{/other_user}","gists_url":"https://api.github.com/users/nicholasehamilton/gists{/gist_id}","starred_url":"https://api.github.com/users/nicholasehamilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicholasehamilton/subscriptions","organizations_url":"https://api.github.com/users/nicholasehamilton/orgs","repos_url":"https://api.github.com/users/nicholasehamilton/repos","events_url":"https://api.github.com/users/nicholasehamilton/events{/privacy}","received_events_url":"https://api.github.com/users/nicholasehamilton/received_events","type":"User","site_admin":false},"created_at":"2015-08-07T08:52:17Z","updated_at":"2015-08-07T08:52:17Z","body":"Thanks for reminding me, I will attend to your issue. Cheers.\n--\nNicholas Hamilton\nSchool of Materials Science and Engineering\nUniversity of New South Wales (Australia)\n--\nwww.ggtern.com<http://www.ggtern.com>\n\nOn 26 May 2015, at 8:47 pm, Gilles Chapron <notifications@github.com<mailto:notifications@github.com>> wrote:\n\n\nHi Nicolas,\n\nIn fact, this is not an issue of your package, but perhaps, you could give me some advice.\n\nI have create a function that use your package in my one 'private' package.\nMy package intensively use ggplot2 in many function, so I use\n\n@import<https://github.com/import> ggplot2 to globaly import it.\n\nI first do the same thing with ggtern :\n\n@import<https://github.com/import> ggtern\n\nwith consequence that my function that create the ternary plot work perfectly. But other function that use only ggplot2 consequently do not anymore...\nI have some\n\nobject of type 'closure' is not subsettable\n\nerror that I have not if I do not build my function using ggtern in my package.\n\nSo, a thing that could I suppose solve the problem is to stop using @import<https://github.com/import> ggtern in my function and to call all the specific ggtern function with \"ggtern::\".\n\nI have tried to to do so in the following code (sorry its not reproductible, but I can give you my all code if necessary):\n\n  plot.demol <- ggplot() + ggtern::coord_tern() +\n    ggtern::geom_segment(data = lim.demolon,\n                 ggtern::aes(x = y, y = x, z = z,\n                     xend = yend, yend = xend, zend = zend),\n                 size = 0.5) +\n    geom_text(data = type.sol, ggtern::aes(x = L, y = T, z = R, label = txt),\n              size = 2.5, lineheight = 0.75) +\n    geom_point(data = granu,\n               mapping = ggtern::aes(y = T, x = L, z = R, shape = sect),\n               colour = formcoul, fill = formcoul, size = 2) +\n    ggtern::scale_T_continuous(name = expression(\"Argile (< \"*2*\" µm)\")) +\n    ggtern::scale_L_continuous(name = expression(\"Limon (\"*2*\" à \"*20*\" µm)\")) +\n    ggtern::scale_R_continuous(name = expression(\"Sable (> \"*20*\" µm)\")) +\n    ggtern::theme_showarrows() +\n    ggtern::theme_arrowlong() +\n    ggtern::theme_hidetitles() +\n    ggtitle(element_blank()) +\n    ggtern::theme(axis.tern.title = element_text(size = 8, face = \"bold\"),\n          axis.tern.text = element_text(size = 7),\n          legend.title = element_blank(),\n          legend.text = element_text(size = 6),\n          legend.background = element_blank(),\n          legend.key = element_blank(),\n          legend.direction = \"horizontal\",\n          legend.position = c(0.5, 1),\n          legend.justification = c(0.5, 0.35),\n          plot.margin= ggtern::unit(c(0.05, 0, 0, 0), \"null\")) +\n    scale_shape_manual(values = sect_concerne[[3]],\n                       breaks = sect_concerne[[1]])\n\nInfortunately I have the error that come I think from ggplot2 that do not interpret a function:\n\nError in UseMethod(\"scale_clone\") :\nno applicable method for 'scale_clone' applied to an object of class \"c('tern_T',\n'continuous_ternary', 'scale')\"\n\nCould you have any idea to help me about it ?\nMy apologies if I'm not in the best place to ask my question...\n\nRegards,\nGilles\n\n—\nReply to this email directly or view it on GitHub<https://github.com/nicholasehamilton/ggtern/issues/21>.\n\n"}}