arrow() in ggplot2 no longer supported

醉酒当歌 提交于 2019-11-28 00:28:00

问题


Installed R 2.15.2 on a new machine and ggplot2. The grid package is no longer supported in this latest version of R, but ggplot2 uses grid for the arrow() function, as in these examples.

http://docs.ggplot2.org/current/geom_segment.html

Haven't been able to find a workaround. Any suggestions?


回答1:


Maybe you think that grid is no more supported because of the message displayed on its CRAN page ? But if it is written that Package ‘grid’ was removed from the CRAN repository, it is because it is now part of the base R distribution, as mentioned on Paul Murrell's grid page.

So library(grid) and the arrow function should work fine.

Some of the confusion may be due to the fact that grid was loaded automatically by previous versions of ggplot (making grid functions visible/accessible to the user); now it's referred to via NAMESPACE imports instead, so you need to explicitly load grid if you want to use grid functions (or look at their help pages).



来源:https://stackoverflow.com/questions/14677035/arrow-in-ggplot2-no-longer-supported

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!