Skip to contents

tibble methods

Methods from {tibble} implemented for Spat* objects.

as_tibble(<SpatRaster>) as_tibble(<SpatVector>)
Coerce a Spat* object to data frames

dplyr methods

Methods from {dplyr} implemented for Spat* objects.


Verbs that principally operate on rows.


Verbs that principally operate on columns.

glimpse(<SpatRaster>) glimpse(<SpatVector>)
Get a glimpse of your Spat* objects
mutate(<SpatRaster>) mutate(<SpatVector>) transmute(<SpatRaster>) transmute(<SpatVector>)
Create, modify, and delete cell values/layers/attributes of Spat* objects
pull(<SpatRaster>) pull(<SpatVector>)
Extract a single layer/attribute
relocate(<SpatRaster>) relocate(<SpatVector>)
Change layer/attribute order
rename(<SpatRaster>) rename_with(<SpatRaster>) rename(<SpatVector>) rename_with(<SpatVector>)
Rename layers/attributes
select(<SpatRaster>) select(<SpatVector>)
Subset layers/attributes of Spat* objects


Verbs that principally operate on groups of rows.

count(<SpatVector>) tally(<SpatVector>)
Count the observations in each SpatVector group
group_by(<SpatVector>) ungroup(<SpatVector>)
Group a SpatVector by one or more variables
Group SpatVector by rows
summarise(<SpatVector>) summarize(<SpatVector>)
Summarise each group of a SpatVector down to one geometry

Spat* and Data frames

Verbs that principally operate on pairs of Spat* and data frames.

Bind multiple SpatVectors and data frames by column
Bind multiple SpatVectors and data frames by row
semi_join(<SpatVector>) anti_join(<SpatVector>)
Filtering joins for SpatVectors
inner_join(<SpatVector>) left_join(<SpatVector>) right_join(<SpatVector>) full_join(<SpatVector>)
Mutating joins for SpatVectors

tidyr methods

Methods from {tidyr} implemented for Spat* objects.

Missing values

Tools for converting between implicit (absent rows) and explicit (NA) missing values, and for handling explicit NAs.

Drop attributes of SpatVector objects containing missing values
replace_na(<SpatRaster>) replace_na(<SpatVector>)
Replace NAs with specified values

ggplot2 methods

Methods from {ggplot2} implemented for Spat* objects.

autoplot(<SpatRaster>) autoplot(<SpatVector>)
Create a complete ggplot for Spat* objects
fortify(<SpatRaster>) fortify(<SpatVector>)
Fortify Spat* Objects

ggplot2 utils


Create {ggplot2} layers for Spat* objects.

geom_spatraster() stat_spatraster()
Visualise SpatRaster objects
Visualise SpatRaster objects as images
geom_spatraster_contour() geom_spatraster_contour_filled()
Plot SpatRaster contours
geom_spatvector() geom_spatvector_label() geom_spatvector_text() stat_spatvector()
Visualise SpatVector objects


Gradient colour schemes, palettes and hypsometric tints.

scale_fill_coltab() scale_colour_coltab() get_coltab_pal()
Discrete scales based in the color table of a SpatRaster
scale_fill_cross_blended_d() scale_colour_cross_blended_d() scale_fill_cross_blended_c() scale_colour_cross_blended_c() scale_fill_cross_blended_b() scale_colour_cross_blended_b() cross_blended.colors() scale_fill_cross_blended_tint_d() scale_colour_cross_blended_tint_d() scale_fill_cross_blended_tint_c() scale_colour_cross_blended_tint_c() scale_fill_cross_blended_tint_b() scale_colour_cross_blended_tint_b() cross_blended.colors2()
Cross blended Hypsometric Tints scales
scale_fill_hypso_d() scale_colour_hypso_d() scale_fill_hypso_c() scale_colour_hypso_c() scale_fill_hypso_b() scale_colour_hypso_b() hypso.colors() scale_fill_hypso_tint_d() scale_colour_hypso_tint_d() scale_fill_hypso_tint_c() scale_colour_hypso_tint_c() scale_fill_hypso_tint_b() scale_colour_hypso_tint_b() hypso.colors2()
Gradient scales for representing hypsometry and bathymetry
scale_fill_terrain_d() scale_colour_terrain_d() scale_fill_terrain_c() scale_colour_terrain_c() scale_fill_terrain_b() scale_colour_terrain_b()
Terrain colour scales from grDevices
scale_fill_whitebox_d() scale_colour_whitebox_d() scale_fill_whitebox_c() scale_colour_whitebox_c() scale_fill_whitebox_b() scale_colour_whitebox_b() whitebox.colors()
Gradient scales from WhiteboxTools color schemes
scale_fill_wiki_d() scale_colour_wiki_d() scale_fill_wiki_c() scale_colour_wiki_c() scale_fill_wiki_b() scale_colour_wiki_b() wiki.colors()
Gradient scales from Wikipedia color schemes


Additional set of functions provided by {tidyterra}.

Coercing objects

Convert Spat* to other type of objects or create SpatRasters from tibbles.

Get cell number, row and column from a SpatRaster
Coerce a SpatVector to a sf object
Coerce a data frame to SpatRaster
Method for coercing objects to to SpatVector
as_tibble(<SpatRaster>) as_tibble(<SpatVector>)
Coerce a Spat* object to data frames
fortify(<SpatRaster>) fortify(<SpatVector>)
Fortify Spat* Objects

Other helpers

Compare attributes of two SpatRasters
Check if x and y positions conforms a regular grid
Extract CRS on WKT format

Built in data

Cross-blended Hypsometric Tints
Hypsometric palettes database
Updated Topographic Information on Auckland's Maungawhau Volcano

About the package

tidyterra tidyterra-package
tidyterra: 'tidyverse' Methods and 'ggplot2' Helpers for 'terra' Objects