cartogram

Cartogram in R not distorting countries as expected

蓝咒 提交于 2021-01-28 23:02:07
问题 I'm using the cartogram package in R to make a world map of living languages. The country map is from Natural Earth, and the language count from the Ethnologue. w <- readOGR('.','ne_110m_admin_0_map_units') L <- read.csv('languages.csv',sep='\t') w$rank <- 1:nrow(w) wl <- merge(w@data,L,by.x='ISO_A3',by.y='iso3',all.x=T) wl <- wl[order(wl$rank),] wl[is.na(wl$Live),'Live'] <- 1 w@data <- wl w2 <- cartogram_cont(w,'Live',prepare='none') plot(w2) The data I'm using has 111 living languages in

D3.js - Changes from path.area in version 2 to version 4

邮差的信 提交于 2019-12-24 11:18:52
问题 I am trying to update d3-cartogram to work with D3.js version 4. So far, everything is going fine — I've just been updating all the functions so that they're written in the flattened namespace of version 4. For example, instead of d3.geo.path() , it's d3.geoPath() . I've also changed a few small things so that the code works with the latest version of TopoJSON. For example, instead of topojson.object(topology, geom).coordinates , it's topojson.feature(topology, geom).geometry.coordinates .

using cartogram.js for visualizing information in a global map

 ̄綄美尐妖づ 提交于 2019-12-24 01:44:55
问题 I'm trying to adapt this example http://prag.ma/code/d3-cartogram/ to show information about obesity in 2002, 2005 and 2010 around the world. This the visualization: http://datauy.github.io/obesity-cartogram with a link to the code in the same page. The problem I'm trying to resolve is that the shapes are not being distorted like in the original example with the alberusa projection. The colors seems to be mapped just fine but for some reason I can't distort the map. I tried changing the scale

Use Rcartogram on a SpatialPolygonsDataFrame object

浪子不回头ぞ 提交于 2019-12-21 00:31:52
问题 I'm trying to do the same thing asked in this question, Cartogram + choropleth map in R, but starting from a SpatialPolygonsDataFrame and hoping to end up with the same type of object. I could save the object as a shapefile, use scapetoad, reopen it and convert back, but I'd rather have it all within R so that the procedure is fully reproducible, and so that I can code dozens of variations automatically. I've forked the Rcartogram code on github and added my efforts so far here. Essentially

Install Rcartogram: error on R CMD INSTALL

帅比萌擦擦* 提交于 2019-12-11 12:13:49
问题 I am trying to use the Rcartogram package. After following the instructions in the answer by Geoff, I received an error that I can't resolve: C:\R\R-3.2.3\library\Rcartogram>R CMD INSTALL --debug . processing '.' a directory * installing to library 'C:/R/R-3.2.3/library' * build_help_types= * DBG: 'R CMD INSTALL' now doing do_install() * created lock directory 'C:/R/R-3.2.3/library/00LOCK-Rcartogram' ERROR: cannot install to srcdir for package 'Rcartogram' * removing C:/R/R-3.2.3/library

Creating a Cartogram in R

百般思念 提交于 2019-12-02 05:45:55
I am trying to make a cartogram in R to show the number of occurrences in each area of the UK. My data currently looks like this: Area Occurences lon lat 1 Greater London East North UK 200 -0.0936496 51.43092 2 Lambeth and Southwark UK 16 -0.1178424 51.49351 3 Black Country UK 58 -2.0752861 52.52005 4 Glasgow UK 45 -4.2518060 55.86424 5 Leeds UK 331 -1.5490774 53.80076 6 Sth Herts or Watford UK 210 -0.3903200 51.65649 I have the longitude and latitude for all of the 120 observations. So far I have used the following code in an attempt to produce a cartogram: library(rgdal) library(cartogram)

Creating a Cartogram in R

余生长醉 提交于 2019-12-02 03:27:48
问题 I am trying to make a cartogram in R to show the number of occurrences in each area of the UK. My data currently looks like this: Area Occurences lon lat 1 Greater London East North UK 200 -0.0936496 51.43092 2 Lambeth and Southwark UK 16 -0.1178424 51.49351 3 Black Country UK 58 -2.0752861 52.52005 4 Glasgow UK 45 -4.2518060 55.86424 5 Leeds UK 331 -1.5490774 53.80076 6 Sth Herts or Watford UK 210 -0.3903200 51.65649 I have the longitude and latitude for all of the 120 observations. So far I

Population-weighted polygon distortion (cartograms)

a 夏天 提交于 2019-11-30 21:21:31
问题 I'm trying to create a map in R that conveys both the shape of underlying geometry (i.e., the physical boundaries) and the relative importance of the object in terms of an associated value. For concreteness, I'd like to focus on reproducing (a version of) the following map* (the shapes , not so much the colors since I can't find the polling data): I also don't want to bother with getting Alaska and Hawaii to appear below the US instead of in their geodesically correct locations. I'm only as

installing Rcartogram packages - error message

南笙酒味 提交于 2019-11-29 07:12:13
I am trying to build a cartogram like here Installation from the link does not work: `install.packages('Rcartogram', repos = 'http://www.omegahat.org/R', type = 'source')` Installing package into ‘C:/Users/Milena/Documents/R/win-library/3.2’ (as `lib` is unspecified) Warning in install.packages : package ‘Rcartogram’ is not available (for R version 3.2.0) Neither from the zip file: install.packages("C:/Users/Milena/Downloads/Rcartogram_0.2-2.tar.gz", repos = NULL, type = "source") Installing package into ‘C:/Users/Milena/Documents/R/win-library/3.2’ (as lib is unspecified) * installing source

installing Rcartogram packages - error message

醉酒当歌 提交于 2019-11-28 00:48:08
问题 I am trying to build a cartogram like here Installation from the link does not work: `install.packages('Rcartogram', repos = 'http://www.omegahat.org/R', type = 'source')` Installing package into ‘C:/Users/Milena/Documents/R/win-library/3.2’ (as `lib` is unspecified) Warning in install.packages : package ‘Rcartogram’ is not available (for R version 3.2.0) Neither from the zip file: install.packages("C:/Users/Milena/Downloads/Rcartogram_0.2-2.tar.gz", repos = NULL, type = "source") Installing