Skip to contents

tibble methods

Methods from tibble implemented for Spat* objects.

as_tibble(<SpatRaster>) as_tibble(<SpatVector>)
Coerce a SpatVector or SpatRaster 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 nice 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 objects by rows
summarise(<SpatVector>) summarize(<SpatVector>)
Summarise each group of a SpatVector down to one geometry

SpatVector and Data frames

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

Bind multiple SpatVector sf and data frames objects by column
Bind multiple SpatVector, sf/sfc and data frames objects by row
semi_join(<SpatVector>) anti_join(<SpatVector>)
Filtering joins for SpatVector objects
inner_join(<SpatVector>) left_join(<SpatVector>) right_join(<SpatVector>) full_join(<SpatVector>)
Mutating joins for SpatVector objects

tidyr methods

Methods from tidyr implemented for Spat* objects.


Pivoting changes the representation of a SpatVector object, without changing the data inside of it.

Pivot SpatVector from wide to long
Pivot SpatVector from long to wide

Missing values

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

drop_na(<SpatVector>) drop_na(<SpatRaster>)
Drop attributes of Spat* objects containing missing values
Fill in missing values with previous or next value on a SpatVector
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.


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_grass_d() scale_colour_grass_d() scale_fill_grass_c() scale_colour_grass_c() scale_fill_grass_b() scale_colour_grass_b() grass.colors()
GRASS 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_princess_d() scale_colour_princess_d() scale_fill_princess_c() scale_colour_princess_c() scale_fill_princess_b() scale_colour_princess_b() princess.colors()
Gradient scales from princess color schemes
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 SpatVector
as_tibble(<SpatRaster>) as_tibble(<SpatVector>)
Coerce a SpatVector or SpatRaster object to data frames
fortify(<SpatRaster>) fortify(<SpatVector>)
Fortify Spat* Objects

Other helpers

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

Built in data

Cross-blended hypsometric tints
GRASS color tables
Hypsometric palettes database
Princess 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