• Stars
    star
    353
  • Rank 120,031 (Top 3 %)
  • Language
    R
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Enhancing spatial visualization in ggplot2

ggspatial

ggspatial on CRAN Coverage Status Lifecycle: stable R-CMD-check

Spatial data plus the power of the ggplot2 framework means easier mapping.

Installation

The package is available on CRAN, and can be installed using install.packages("ggspatial"). The development version can be installed via remotes.

install.packages("ggspatial")

Or for the development version:

install.packages("remotes") # if remotes isn't installed
remotes::install_github("paleolimbot/ggspatial")

Introduction

This package is a framework for interacting with spatial data using ggplot2 as a plotting backend. The package supports sf package objects, sp package objects, and raster package objects, and uses geom_sf() and coord_sf() to do most of the heavy lifting with respect to coordinate transformation.

library(ggplot2)
library(ggspatial)
load_longlake_data()

ggplot() +
  # loads background map tiles from a tile source
  annotation_map_tile(zoomin = -1) +
  
  # annotation_spatial() layers don't train the scales, so data stays central
  annotation_spatial(longlake_roadsdf, size = 2, col = "black") +
  annotation_spatial(longlake_roadsdf, size = 1.6, col = "white") +

  # raster layers train scales and get projected automatically
  layer_spatial(longlake_depth_raster, aes(colour = after_stat(band1))) +
  # make no data values transparent
  scale_fill_viridis_c(na.value = NA) +
  
  # layer_spatial trains the scales
  layer_spatial(longlake_depthdf, aes(fill = DEPTH_M)) +
  
  # spatial-aware automagic scale bar
  annotation_scale(location = "tl") +

  # spatial-aware automagic north arrow
  annotation_north_arrow(location = "br", which_north = "true")

More Repositories

1

rbbt

R Interface to the Better BiBTex Zotero Connector
R
134
star
2

geoarrow

Extension types for geospatial data for use with 'Arrow'
C
124
star
3

geos

Open Source Geometry Engine ('GEOS') R API
R
60
star
4

wk

Lightweight Well-Known Geometry Parsing
R
43
star
5

exifr

Read EXIF data in R using ExifTool
R
33
star
6

tidypaleo

Tidy tools for paleoenvironmental archives
R
32
star
7

narrow

An R interface to the 'Apache Arrow' C API
C
30
star
8

s2geography

Simple features (ish) for s2geometry
C++
27
star
9

geovctrs

Common Classes and Data Structures for Geometry Vectors
R
25
star
10

mudata2

Interchange Tools for Multi-Parameter Spatiotemporal Data
R
24
star
11

rosm

Plot Open Street Map and Other Tiles in R
R
24
star
12

prettymapr

Scale Bar, North Arrow, and Pretty Margins in R
R
22
star
13

CanadaWeather

Canadian Weather from Environment Canada for Android
Java
20
star
14

tidyphreeqc

Tidy geochemical modeling using PHREEQC
R
20
star
15

libgeos

Open Source Geometry Engine (GEOS) C API
C++
18
star
16

rclimateca

An R Package to fetch climate data from Environment Canada
R
16
star
17

chemr

data structures for chemistry in R
R
16
star
18

libproj

Generic Coordinate Transformation Library ('PROJ') C API
C
16
star
19

crs2crs

Generic Coordinate System Transforms
R
14
star
20

shp

Read Shapefiles
C
11
star
21

geoarrow-data

R
11
star
22

ggr6

An Implementation of the Grammar of Graphics in R6
R
11
star
23

s2plot

Plot spatial objects on a sphere
R
10
star
24

JupyterQt

Python
10
star
25

grd

Raster and Grid Geometry
R
9
star
26

gpkg

Proof of Concept 'GeoPackage' to Arrow Converter
C
9
star
27

ggdebug

Debug functions and ggproto methods in ggplot2
R
8
star
28

geoarrow-cpp-old

C++
8
star
29

tf

'TensorFlow' C API Wrapper
R
8
star
30

rcanvec

Access and plot CanVec and CanVec+ data for rapid basemap creation in Canada
R
8
star
31

xrftools

XRF tools for R
HTML
8
star
32

pb210

Lead-210 dating utilities
R
7
star
33

pkd

Compact Integer and Float Vectors
R
7
star
34

carbon14

Tidy Radiocarbon Dating Tools
R
7
star
35

rstudioconf2020

Source + slides for rstudio::conf(2020) presentation
R
7
star
36

rtree

Experimental 'RTree' Spatial Indexing
C++
7
star
37

r4transform2021

7
star
38

metal

See If We Can Use Apple Metal In R
C++
6
star
39

datafusion

Experimental R Bindings to Datafusion
Rust
6
star
40

dflite

Lightweight DataFrame for data science.
Python
6
star
41

geocrs

Create and Validate Coordinate Reference System Definitions
R
6
star
42

physical-geology

A bookdown version of "Physical Geology" by Karla Panchuk and Steven Earle
HTML
6
star
43

grib

Read Gridded Binary ('GRIB') Files
C
5
star
44

wkutils

Utilities for Well-Known Geometry Vectors
C++
5
star
45

minimal-thesis-bookdown

TeX
5
star
46

demoadbcplyr

Demonstrate 'dbplyr' through 'ADBC' via FlightSQL
R
5
star
47

rlibpal

Label placement using libpal
C++
5
star
48

rfc86

Tests GDAL RFC 86 Columnar API
R
5
star
49

easyphreeqc

A slightly easier R interface to phreeqc modeling
R
4
star
50

radbc

Experiments with ADBC
C
4
star
51

nanoarrow

Helpers for Arrow C Data & Arrow C Stream interfaces
C
4
star
52

ggoce

Plot 'oce' objects using 'ggplot2'
R
4
star
53

electionca

Canadian Elections Data
R
4
star
54

tidystats

Tidy data port of the stats package
R
4
star
55

geoproj

Low-level Access to the PROJ Library
C++
4
star
56

ggpy

python ggplot without matplotlib
Python
3
star
57

ggverbs

Verbifying noun functions in the ggplot2 package
R
3
star
58

r2d3globe

Intractive Globes for 'Rmarkdown' and 'shiny' using 'D3'
HTML
3
star
59

shinyex_enfr

R
3
star
60

r4ags

Workshop materials for the R+ggplot2 for geoscience course
3
star
61

rparquet

(Experiment) Read and Write 'Parquet' Files
Rust
3
star
62

rproj

Generic Coordinate Transformation Library ('PROJ') R API
R
3
star
63

sbe

Process and Convert Files Created by 'Seabird' Products
R
2
star
64

2021-04-30_dfo-git

2
star
65

hydatr

An R interface to the HYDAT database
R
2
star
66

JavaUnits

Flexible java unit library
Java
2
star
67

anrpackageusingc

Demonstrates Calling 'C' Code
R
2
star
68

r4paleolim

R for Paleolimnology
TeX
2
star
69

minigpkg

Proof-of-concept minimal GeoPackage IO
C
1
star
70

oceandf

Read 'ODF' (Ocean Data File) Files
R
1
star
71

pyosmroute

Python
1
star
72

plotwp

Wordpress Plugin to attach data to posts
PHP
1
star
73

2021-10-27_dfo-gh-actions

1
star
74

qosm

OpenStreetMaps tiles for QGIS
Python
1
star
75

ggstereo

Stereonets in R
R
1
star
76

dfoxaringan

Provides a DFO 'rmarkdown' template for 'xaringan' presentations
CSS
1
star
77

arce00

Read E00 Files
C
1
star
78

docker-images

Dockerfile
1
star
79

landsatutils

R package with convenience functions for Landsat workflows
R
1
star
80

testpackageusingarrowcpp

Experimenting With Various Ways to Do Stuff With 'Arrow'
R
1
star
81

swmm

Cross-platform access to the USEPA Stormwater Management Model (SWMM) in R
C
1
star
82

edwards97

Implementation of a Langmuir Semi-Empirical Coagulation Model
R
1
star
83

bsrto

Access Data from the Barrow Strait Real Time Observatory
R
1
star
84

cwrs_poster_template

CSS
1
star
85

2023-11-21_arrow-over-http-scratchpad

Python
1
star
86

nmea

Parse 'NMEA' Sentences
R
1
star