(Unscientific) list of popular R packages for spatial analysis

On Twitter I asked about R packages people are using to conduct spatial analysis. I’m interested in knowing what people are actually using on a day-to-day basis. It goes without saying that this is extraordinarily unscientific but I got 27 replies with a total of 45 packages, many of which I’ve never heard of before (the full list is below).

In total, 18 of these packages were listed by more than one person and seven were listed by at least five people.

Not surprisingly to me sf and raster lead the way and there are still a lot of people using sp. Note that I’d probably argue if you’re using sp for more than working with legacy code/packages it’s time to switch to sf!

For mapping leaflet, tmap and mapview were most reported but there was some enthusiasm for cartography.

Update May 10, 2019: there were some additional replies since I wrote this post. These mostly followed the pattern from the previous tweets (sf, raster, sp etc) there were also a couple of additions (mapdeck, rnaturalearth, landscapemetrics). I’ve added these to the table but I have not updated the table counts.

The packages I most commonly use

In terms of my own use of packages, in order of use, I’d say sf, raster, tmap, gstat, rmapshaper plus tigris/tidycensus.

My original tweet

R packages for spatial analysis sorted by number of people reporting usage

R package Replies
sf 16
raster 11
ggplot 9
sp 8
leaflet 8
tmap 6
mapview 5
rgdal 4
cartography 3
gstat 3
tigris 3
ggmap 2
ggspatial 2
rgeos 2
rgrass7 2
spatstat 2
spdep 2
stars 2
mapdeck 2
tidycensus 2
arcgisbridge 1
gdalUtils 1
geobuffer 1
geogrid 1
ggsn 1
lwgeom 1
mapedit 1
maptools 1
proj4 1
rasterVis 1
rmapshaper 1
RSToolbox 1
Sen2agri 1
spatialEco 1
tricolore 1
vegan 1
rwgeom 1
Rpostgres 1
Rczechia 1
concaveman 1
vapour 1
geojsonio 1
rayshader 1
leastcostpath 1
kernlab 1
geoR 1
landscapemetrics 1
rnaturalearch 1

 

Code to count downloads of the packages

This code takes the list of spatial-related packages on the CRAN Task View: Analysis of Spatial Data and orders them by number of monthly downloads of the package. This list is probably less helpful as it includes dependencies but is interesting nonetheless. Code followed by the table.

 

 

package count
igraph  423,428
RColorBrewer  416,944
sp  213,365
viridis  190,704
maptools  182,899
nlme  134,431
sf  111,522
rgdal  109,544
classInt  88,706
raster  83,411
maps  69,265
rgeos  60,542
leaflet  51,572
vegan  44,819
spdep  43,552
deldir  40,745
ggmap  38,670
RPostgreSQL  35,908
ade4  32,157
fields  32,089
RgoogleMaps  29,833
mapproj  28,061
geosphere  21,931
spatstat  21,827
gstat  20,669
mapview  19,378
ncdf4  17,986
lwgeom  17,642
tmap  17,040
spacetime  13,279
pastecs  12,900
mapdata  12,418
geojsonio  10,029
splancs  9,803
stars  9,006
akima  8,194
RandomFields  7,759
rasterVis  7,355
adehabitatMA  6,749
geoR  6,611
geojson  6,522
sgeostat  6,500
adehabitatLT  6,376
rworldmap  6,201
RNetCDF  6,093
shapefiles  5,614
tigris  5,457
ash  5,435
spatial  5,157
plotKML  4,407
adehabitatHR  4,373
rnaturalearth  4,358
gdalUtils  4,312
tripack  4,147
geonames  3,883
automap  3,819
PBSmapping  3,617
spaMM  3,593
OpenStreetMap  3,469
rgbif  3,416
splm  3,273
MBA  3,260
cartogram  3,198
tidycensus  3,017
tgp  2,978
RSAGA  2,723
geostatsp  2,620
spatialreg  2,585
gdistance  2,413
cshapes  2,394
geoRglm  2,326
geoaxe  2,250
GWmodel  2,114
cartography  2,106
adehabitatHS  1,996
SpatialEpi  1,980
mapedit  1,903
ggsn  1,900
sphet  1,821
Guerry  1,709
stplanr  1,695
spgwr  1,672
rworldxtra  1,593
GEOmap  1,438
ncf  1,435
spsurvey  1,369
lctools  1,361
spBayes  1,349
taRifx  1,322
marmap  1,291
CARBayes  1,223
PBSmodelling  1,213
RQGIS  1,200
regress  1,172
osmar  1,166
rgrass7  1,151
trip  1,105
siplab  1,084
georob  1,076
spgrass6 998
plotGoogleMaps 937
landscapemetrics 921
aspace 898
geomapdata 898
rpostgis 883
cleangeo 880
inlmisc 854
SpatialExtremes 846
dbmss 839
spatial.tools 814
SpatialTools 791
geogrid 771
spatialsegregation 768
leafletR 762
ads 747
DCluster 726
landsat 719
constrainedKriging 707
spTimer 698
PReMiuM 693
latticeDensity 689
spcosa 685
gmt 680
intamap 680
sparr 678
lawn 669
CompRandFld 658
FRK 658
diseasemapping 651
McSpatial 638
ecespa 635
spatialprobit 632
spatialCovariance 629
AMOEBA 628
mapmisc 622
ngspatial 619
rangeMapper 613
RSurvey 612
RArcInfo 604
wkb 601
ModelMap 595
SpatialPosition 590
recmap 586
geometa 585
DSpat 584
ramps 575
statebins 575
spatgraphs 571
SSN 567
geospt 566
postGIStools 566
FieldSim 565
micromap 555
seg 554
ipdw 547
spatsurv 546
rtop 545
areal 544
spmoran 542
spBayesSurv 536
shp2graph 524
tripEstimation 519
smacpod 517
ExceedanceTools 514
spm 514
geosapi 511
gwrr 502
geospacom 501
spsann 500
GriegSmith 494
sperrorest 487
ProbitSpatial 485
UScensus2000tract 481
Stem 479
HSAR 474
RPyGeo 461
spind 460
gear 459
magclass 449
Watersheds 448
spacom 447
vardiag 446
UScensus2000cdp 444
ows4R 442
geonapi 440
smerc 440
vec2dtransf 438
OasisR 420
quickmapr 419
starma 418
spanel 406
S2sls 387
spselect 378
qualmap 360
rcosmo 360

Leave a Reply

Your email address will not be published. Required fields are marked *