tidyterra (development version)
- Adapt deprecation of ggplot2 (4.0.0):
-
geom_spatvector_label()/geom_spatvector_text():label.sizeaesthetic replaced bylinewidth. Alsonudge_xandnudge_yare not explicitly documented and are passed toggplot2::geom_sf_label()/_text()via dots (...).
-
-
get_coltab_pal()can extract colors with alpha values (#180). - New dependency generics added to Imports. New methods (
SpatRaster,SpatVector,SpatGraticule,SpatExtent) included: -
fortify.Spatmethods now usestidy.Spatmethods under the hood:- New
fortify.SpatExtent()method.
- New
- New
autoplot.SpatExtent()andautoplot.SpatGraticule()methods.
tidyterra 0.7.1
CRAN release: 2025-04-07
- New parameters in
geom_spatraster_*:mask_projection. When set toTRUEavoidSpatRasterto wrapping around on some projections (see #115 and #169, by @dramanica). - Fix an old bug exposed after terra 1.8-42: Plots crash when using
ggplot2::facet_wrap()in combination withcoord_sf()(or with implicit change of CRS due to othersf/Spat*objects).
tidyterra 0.7.0
CRAN release: 2025-02-03
- Minimal version of terra required is
1.8-10. - Remove metR from Suggests.
- Improve handling of factors when several layers have different levels. This is done using
terra::combineLevels()(terra >=1.8-10). See https://stackoverflow.com/questions/79340152. - Now
scalesthat uses limits truncate the legend whenlimitsparameter is provided (#165 @Fan-iX). Scales impacted:-
scale_*_cross_blended_tint_candscale_*_cross_blended_tint_b. -
scale_*_hypso_tint_candscale_*_hypso_tint_b. -
scale_*_grass_candscale_*_grass_b.
-
- Now
geom_spatraster()(and overall pivoting ofSpatRasteris less strict with different layer classes: if several layers can be defined as numeric (i.e.double,integerandnumeric) the pivoting (and therefore the plot) can be performed. This is consistent withtidyr::pivot_longer()behavior (https://stackoverflow.com/questions/79292989).
tidyterra 0.6.2
CRAN release: 2025-01-08
- Add (limited) support for
SpatGraticule(seeterra::graticule()) #155. - New arguments in
geom_spatraster_rgb():stretchandzlim. Seeterra::plotRGB()for clarification. -
geom_spatraster()suggestsgeom_spatraster_rgb()when aSpatRasterwith RGB specification is detected (terra::has.RGB()isTRUE)
tidyterra 0.6.1
CRAN release: 2024-06-08
- Add new scales:
-
grass_dbandscale_fill_grass_c()family. This is an implementation ofterra::map.pal(), that is the default palette forterra::plot()(> 1.7.78). -
autoplot.SpatRaster()now uses alsograss_dbas the default palette. - Add
scale_fill_princess_c()scale family.
-
- Fix tests.
tidyterra 0.6.0
CRAN release: 2024-04-22
- Requires ggplot2 (>= 3.5.0).
- New methods for
SpatVectorobjects: - New geom
geom_spatraster_contour_text()implemented on top ofisoband::isolines_grob().
-
glimpse.SpatRaster()andglimpse.SpatVector()now displays information using?tibble::print.tbl_dfapproach for the header and the footer. The body is still displayed transposed as ofdplyr::glimpse(). Seepillar::tbl_format_header()andpillar::tbl_format_footer()for examples. -
as_sf()converts aSpatVectorto asfobject with an additionaltbl_dfclass for pretty printing. -
fortify.SpatRaster()gains a new argumentpivotthat allows better integration with other ggplot2 geoms when pivoting. This is a wrapper oftidyr::pivot_longer(). - Tidy documentation.
- metR added to Suggests.
tidyterra 0.5.2
CRAN release: 2024-01-19
- Adapt tests to ggplot2 3.5.0 (#129) @teunbrand.
- Reduce package size, specially relevant in the external raster
asia.tif.
tidyterra 0.5.0
CRAN release: 2023-11-21
tidyterra has been accepted on JOSS. Please use the result of citation("tidyterra") or the following string:
Hernangómez, D. (2023). “Using the tidyverse with terra objects: the tidyterra package.” Journal of Open Source Software, 8(91), 5751. ISSN 2475-9066, https://doi.org/10.21105/joss.05751
Other changes on this version:
- Support for
SpatRasterobjects with a color table-
autoplot.SpatRaster()can detect nowSpatRasterobjects with color tables. -
geom_spatraster()can detect nowSpatRasterobjects with color tables. - New scales for plotting
SpatRasterobjects with color tables:scale_fill_coltab()and rest of family scales (colour). - tidyverse verbs keeps the associated
coltabof aSpatRaster.
-
- By default all the discrete scales of tidyterra now have the following setup:
na.translate = FALSE. - By default, all the non-discrete (e.g. continuous or breaks) scales of tidyterra have now
na.value = "transparent"(#120). - Enhanced
glimpse.Spat()with meta-information on type of geometry, crs, etc. - New messaging interface thanks to cli package.
tidyterra 0.4.0
CRAN release: 2023-03-17
- This release focuses heavily on
SpatVectorobjects. The improvements have been:- New methods for
SpatVector:glimpse.SpatVector()arrange.SpatVector()distinct.SpatVector()-
inner_join.SpatVector(),left_join.SpatVector(),right_join.SpatVector()andfull_join.SpatVector() -
semi_join.SpatVector()andanti_join.SpatVector() summarise.SpatVector()rowwise.SpatVector()-
group_by.SpatVector(),ungroup.SpatVector() -
count.SpatVector(),tally.SpatVector() -
bind_spat_cols(),bind_spat_rows()
- Already implemented methods now works with
dplyr::group_by(). - Internal review of code. Now the methods does not rely on
sf::st_as_sf()coercion. In fact coercion between object classes is avoided as much as possible.
- New methods for
- New
glimpse.SpatRaster()method forSpatRaster. - Other coercing and helper functions:
tidyterra 0.3.2
CRAN release: 2023-02-24
- Fix a bug on
pull_crs()that returned"NA"onsfobjects with any field equal toNA(#74). - Improve docs on
scales_*(#73) . - Remove dependency on crayon package (superseded) in favor of cli.
- Remove tidyverse from Suggests.
tidyterra 0.3.1
CRAN release: 2022-11-09
- New ggplot2 methods added:
- Methods for
autoplot.SpatVector(),autoplot.SpatRaster().-
autoplot.SpatRaster()now is smarter on identifying the type of plot to produce. Can still be overridden with parameters.
-
- Methods for fortifying
SpatRasterandSpatVectorobjects:fortify.SpatRaster(),fortify.SpatVector().
- Methods for
- Three additional palettes are included on
hypso.colors():"artic","meyers"and"nordisk-familjebok". - Added colour scales to all palettes:
scale_colour_*. - Remove use of
ggplot2::aes_string(). - Adapt
geom_spatraster_contour()andgeom_spatraster_contour_filled()to the changes introduced in ggplot2 (3.4.0), most notably the adoption oflinewidth = .2, by default.
tidyterra 0.3.0
CRAN release: 2022-10-12
- Package back to CRAN.
- Libraries dplyr, tidyr, tibble are not attached by default. Needed functions are reexported instead.
- Improvements on
geom_spatraster():- Now in
geom_spatraster()is possible to avoid the defaultfillof the layer usinggeom_spatraster(fill = NA)orgeom_spatraster(aes(fill = NULL)). -
aes(fill = ggplot2::after_stat())now works ongeom_spatraster(). - Internal: Better handling of
aes()and layers
- Now in
- Add new function
stat_spatraster(). - Reduce the size of external files.
tidyterra 0.2.2
CRAN release: 2022-09-29
- Changes on how dplyr, tibble and tidyr are attached. Now these packages are listed on ‘Depends’ and are attached before tidyterra when
libraryorrequireis called. Messages on load can be suppressed withsuppressPackageStartupMessages(library(tidyterra)).
tidyterra 0.2.1
CRAN release: 2022-09-23
- Now
geom_spatraster_rgb()works withfacet_wrap()(#35) - Improve faceting when the plot facets are created using non-Spat* layers.
- Precompute vignettes.
tidyterra 0.2.0
CRAN release: 2022-06-21
- Recreate
extdata/volcano2.tifusing official DEM information from New Zealand. Source: Auckland LiDAR 1m DEM (2013). - Add
volcano2dataset. - Fix errors on
slice_min()andslice_max()forSpatRasterobjects (#20). Also add a new parameterna.rm. - Add new gradient scales for use on hypsometry:
- Add new
asia.tiffile onextdata.
tidyterra 0.0.1
- Improvements on performance:
- Conversion to tibble is avoided as much as possible.
- Internally use
data.tablesinstead oftibbles. - The package is compatible with dtplyr.
-
as_spatraster()handles tibbles with characters and factors. - Simplification and tests for
geom_spatraster()andgeom_spatraster_rgb(). - New methods:
- New geoms:
-
geom_spatraster_contour()family.
-
