rworldmap

Filling countries and continents with maps library according to variable value

六眼飞鱼酱① 提交于 2020-01-24 20:58:26
问题 I want to fill a map with some countries from UE, and then some continents like Asia and Africa, according to my variable prob2 values . This is my data map_d : state prob2 <chr> <dbl> Germany 0.6 Austria 2.9 Belgium 1.9 Bulgaria 0.6 Cyprus 0.0 Croatia 1.7 ... Other Asian 9.2 Other African 2.5 Other North American 10.7 Other Latin American 2.3 Other Oceania 5.0 Firstly I fill the countries of Europe, using this code: europ_map <- map_data("world", region = c( "Germany", "Austria", "Belgium",

Package (rworldmap) can not be loaded in R software

你。 提交于 2020-01-06 12:53:08
问题 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

How to adjust the legend length in rworldmap?

我的未来我决定 提交于 2019-12-23 05:32:34
问题 I would like to adjust the legend bar of rworldmap. mapCountryData(df, nameColumnToPlot="users", xlim=NA, ylim=NA, mapRegion="World", numCats=30, catMethod="pretty", addLegend=TRUE, mapTitle="map1", colourPalette=c("heat")) do.call(addMapLegend, c(mapParams, legendLabels="all", legendWidth=0.5, legendIntervals="data", legendMar=2)) I was able to generate the map, but failed to adjust the legend bar. The legend layout was across the map, which did not look well. Error in do.call(addMapLegend,

R: How to create multiple maps (rworldmap) using apply?

你说的曾经没有我的故事 提交于 2019-12-20 05:47:16
问题 I want to create multiple maps (similar to this example) using the apply family. Here a small sample of my code (~200 rows x 150 cols). (UN and ISO3 are codes for rworldmap): df <- structure(list(BLUE.fruits = c(12803543, 3745797, 19947613, 0, 130, 4), BLUE.nuts = c(21563867, 533665, 171984, 0, 0, 0), BLUE.veggies = c(92690, 188940, 34910, 0, 0, 577), GREEN.fruits = c(3389314, 15773576, 8942278, 0, 814, 87538 ), GREEN.nuts = c(6399474, 1640804, 464688, 0, 0, 0), GREEN.veggies = c(15508,

Convert latitude and longitude coordinates to country name in R

穿精又带淫゛_ 提交于 2019-12-17 10:58:18
问题 I have a list of latitude and longitude coordinates, and wish to find out which country they all reside in. I modified an answer from this question about lat-long to US states, and have a working function, but I run into the problem that the worldHires map (from the mapdata package) is hideously out of date and contains a lot of obsolete countries such as Yugoslavia and the USSR. How would I modify this function to use a more modern package, such as rworldmap ? I have only managed to

Convert latitude and longitude coordinates to country name in R

守給你的承諾、 提交于 2019-12-17 10:58:02
问题 I have a list of latitude and longitude coordinates, and wish to find out which country they all reside in. I modified an answer from this question about lat-long to US states, and have a working function, but I run into the problem that the worldHires map (from the mapdata package) is hideously out of date and contains a lot of obsolete countries such as Yugoslavia and the USSR. How would I modify this function to use a more modern package, such as rworldmap ? I have only managed to

Poor resolution of raster plot when output to file

我只是一个虾纸丫 提交于 2019-12-13 13:33:31
问题 I have a reasonably high definition global map raster and want to plot to file, but cannot seem to maintain resolution. Plotting a restricted region works ok, but the whole world always ends up with reduced resolution, no matter what method I've used. Am I missing something here? I've often output high-res rasters before without this problem, but I'm unable to identify the cause in this case. To illustrate: require(raster) require(rworldmap) data(countriesCoarse); worldmap = countriesCoarse

Crosslet Package not Working

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 12:16:29
问题 https://github.com/ramnathv/rMaps I tried reproducing this example and the map isn't showing: library(rMaps) crosslet( x = "country", y = c("web_index", "universal_access", "impact_empowerment", "freedom_openness"), data = web_index ) Do I not have a package that will allow this to happen. I have installed the following: rCharts rMaps jsonlite 来源: https://stackoverflow.com/questions/32830566/crosslet-package-not-working

Names of the countries on the plot with rworldmap

回眸只為那壹抹淺笑 提交于 2019-12-07 11:55:42
问题 Good morning, I have spent a lot of time to figure out how can I add a country names directly on plot not like a part of legend, but like part of map. Im using package rworldmap, tried to use identifyCountries () - but it something for interaction (when a user clicks on the map), than I have found a such solution Administrative regions map of a country with ggmap and ggplot2 but it's for ggplot2, and too complicated. Im trying to do it with mapCountryData() . Hope for your help, thanks. data

plotting multiple maps using rworldmap library

我们两清 提交于 2019-12-06 13:51:30
问题 I want to plot multiple maps using rworldmap, where each column is a separate month and the rows are years. I know this can be done in ggmap using facet_grid. How can I do this using rworldmap? For example, the mydata file contains columns for the latitude , longitude , month and year of each point. My code so far: library(rworldmap) newmap <- getMap(resolution = "high") plot(newmap, xlim = c(110, 155), ylim = c(-35, -20), asp = 1) p1 <- read.csv("mydata.csv") points(p1$lon, p1$lat, col =