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.

Rows

Verbs that principally operate on rows.

Columns

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

Groups

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
rowwise(<SpatVector>)
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_spat_cols()
Bind multiple SpatVector sf and data frames objects by column
bind_spat_rows()
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

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

pivot_longer(<SpatVector>)
Pivot SpatVector from wide to long
pivot_wider(<SpatVector>)
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(<SpatVector>)
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

Geoms

Create ggplot2 layers for Spat* objects.

Scales

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

Helpers

Additional set of functions provided by tidyterra.

Coercing objects

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

as_coordinates()
Get cell number, row and column from a SpatRaster
as_sf()
Coerce a SpatVector to a sf object
as_spatraster()
Coerce a data frame to SpatRaster
as_spatvector()
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_spatrasters()
Compare attributes of two SpatRaster objects
is_regular_grid()
Check if x and y positions conforms a regular grid
pull_crs()
Extract CRS on WKT format

Built in data

cross_blended_hypsometric_tints_db
Cross-blended hypsometric tints
grass_db
GRASS color tables
hypsometric_tints_db
Hypsometric palettes database
princess_db
Princess palettes database
volcano2
Updated topographic information on Auckland's Maungawhau volcano

About the package

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