Package (rworldmap) can not be loaded in R softwar

2019-08-27 00:58发布

问题:

When I load the rworldmap package, it can not be loaded in R software (version: 3.0.3).

The rworldmap package has been installed.
Code: library(rworldmap)

Wrong information appeared on the window as follows:

" Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘fields’
Error: package or namespace load failed for ‘rworldmap’ "

How to tackle it? Thanks for your attention.

回答1:

Try this in R studio where Dependent packages are automatically get installed .

In base R you Want this packages package ‘spam’ successfully unpacked and MD5 sums checked package ‘fields’ successfully unpacked and MD5 sums checked package ‘rworldmap’ successfully unpacked and MD5 sums checked



回答2:

Try this

Install package map 
library("ggmap")
library(maptools)
library(maps)
map("world", fill=TRUE, col="white", bg="lightblue", ylim=c(-60, 90), mar=c(0,0,0,0))