在控制台中运行这些命令,输出结果是:tidyverse干扰ggplot2?不能访问map_data
> cty0 = ggplot2::map_data("county")
> library(tidyverse)
Loading tidyverse: ggplot2
Loading tidyverse: tibble
Loading tidyverse: tidyr
Loading tidyverse: readr
Loading tidyverse: purrr
Loading tidyverse: dplyr
Conflicts with tidy packages -----------------------------------------------------------------------------------------------
filter(): dplyr, stats
lag(): dplyr, stats
map(): purrr, maps
> cty0 = ggplot2::map_data("county")
Error: ggplot2 doesn't know how to deal with data of class list
我可以叫map_data("county")
罚款,直至tidyverse
被加载,那么它失败。如何加载加载了tidyverse
的县地图数据?
我猜测,虚线下方的项目是从控制台消息,但你真的应该澄清。似乎'purrr'中的'map'函数掩盖了'maps'包中的'map'函数。如果您需要“映射”(的地理概念)比您需要(映射)的(功能 - 计算机语言概念)更多的原因,则可以颠倒加载tidyverse和映射的顺序。您可能需要开始新的会话才能成功。 '库'函数检查一个包是否已经加载,如果是这样,什么也不做。 –
我会提到这与开发者tidyverse以及。 –