无法运行map_data("state") [英] Cannot run map_data("state")

查看:68
本文介绍了无法运行map_data("state")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在R中的美国地图上工作.我已经做了很多次,但是这次,当我尝试加载时,它给了我这个错误:

I am trying to work on a US map in R. I have done it a lot of times but this time it gives me this error when I try to load:

us<- map_data("state")
Error in .C(C_map_type, as.character(mapbase), integer(1)) : 
  Incorrect number of arguments (2), expecting 0 for ''

我已加载ggmap和ggplot2库.我要去哪里错了?

I have ggmap and ggplot2 libraries loaded. Where am I going wrong?

推荐答案

您需要与ggmap一起使用的地图"包.

You need the 'maps' package along with ggmap.

library(maps)
library(ggmap)
us<- map_data("state")

这应该有效

这篇关于无法运行map_data("state")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆