NEWS
sfhotspot 1.1.1 (2026-09-30)
- Package tests now streamlined to reducing CRAN testing time (#98).
sfhotspot 1.1.0
- New function
hotspot_dbscan() to identify clusters using the DBSCAN
algorithm, as implemented in the dbscan
package. Its min_pts and eps parameters are selected automatically by
default from the number of points and nearest-neighbour distances,
respectively. Also added corresponding autoplot() and autolayer()
methods.
- New function
hotspot_isoband() to generalise values in regular square
hotspot grids into tidy SF isobands with appropriate visual representation
(#81).
- New function
hotspot_map() to produce quick maps of the objects produced by
functions in the hotspot_*() family, as well as of generic sf objects. By
default, maps produced by hotspot_map() include a base map while those
produced using autoplot() methods do not.
- New function
hotspot_layer() provides a student-friendly wrapper around
ggplot2::autolayer() for adding sfhotspot results to custom ggplot2 maps.
hotspot_gistar() and hotspot_classify() now use the default Holm method
when p_adjust_method = NULL. P-values are adjusted once using
spdep::p.adjustSP(); hotspot_classify() no longer applies a second
adjustment across time periods. Use p_adjust_method = "none" to retain
unadjusted p-values (#94).
- Added
autoplot() and autolayer() methods for hotspot_gistar() and
hotspot_dual_kde() results, and completed the plotting support for
hotspot_classify() results. Plot scales and legends now reflect the
semantics of each result, including the comparison method used for dual KDE
and significance/sign filtering for Gi* results. A new website plotting
article demonstrates each distinct behaviour (#85).
hotspot_clip() can now clip any type of geometry, not just point data (#65,
#78) and produces warnings if clipping changes the geometry type of any
features in a way that might create downstream problems.
hotspot_clip() now preserves the specialised hspt_* class of results
produced by other package functions (#71).
hotspot_gistar() results now have the specialised class hspt_g, allowing
downstream functions to identify gistar as their primary value column
(#82).
- Existing plotting methods now use transparent missing values, weighted counts
when present, sequential scales anchored at zero, and balanced diverging
scales for signed values (#85, #86).
hotspot_clip() no longer reports that zero rows were removed when all input
features fall within the clipping boundary (#66).
hotspot_clip() no longer suppresses warnings produced by
sf::st_intersection() other than the constant "attribute variables are
assumed to be spatially constant throughout all geometries" (since this is
rarely relevant).
hotspot_gistar() now calculates KDE values for longitude/latitude data by
automatically transforming them to a projected co-ordinate reference system
and transforming the results back afterwards (#68).
hotspot_dual_kde() now calculates valid KDE values for longitude/latitude
data while using a common automatically selected bandwidth for both layers,
and checks that both point layers overlap the analysis grid (#67).
hotspot_gistar() now uses weighted counts to calculate Gi* statistics and
p-values when weights are supplied, and autoplot()/autolayer() plot use
weighted counts when they are present (#86).
- Automatic CRS transformation using
st_transform_auto() in KDE-related
functions now correctly restores the original geographic CRS rather than
converting to EPSG:4326 even when another geographic CRS was originally used
(#89).
- Automatic CRS transformation using
st_transform_auto() in hotspot_kde()
and hotspot_gistar() now ensures the same CRS is selected for both data
and grid (#90).
sfhotspot 1.0.0 (2025-07-29)
- New function
hotspot_clip() added to extract points from an SF object inside
the boundary of a polygon (#57).
- By default lat/lon data is now transformed to use a projected co-ordinate
reference system before kernel density estimation and then transformed
back afterwards (previously trying to run KDE on lat/lon data resulted in an
error). Datasets can also be automatically transformed to/from lat/lon using
st_transform_auto() (#48).
- Functions now return useful error if provided with an empty dataset (#58).
- Adjusted bandwidth now reported accurately (#56).
- Removed dependency on the rmarkdown package in favour of using the quarto
package to generate vignettes.
sfhotspot 0.9.2
hotspot_grid() handles certain invalid polygon geometries (#54).
sfhotspot 0.9.1 (2025-02-19)
hotspot_grid() handles non-multipolygon input geometries (#46).
hotspot_dual_kde(), hotspot_gistar() and hotspot_kde() now warn if
KDE bandwidth is smaller than cell size (#29).
count_points_in_polygons() (which is used internally to count points in
all the hotspot_*() family of functions) now respects quiet = TRUE (#52).
- Conditions now formatted with the cli package and following the Tidyverse
Style Guide for errors (#47).
sfhotspot 0.9.0 (2025-02-10)
count_points_in_polygons() now passes through columns in the original
dataset, which makes hotspot_count() more useful (#41).
hotspot_grid() if provided with polygons now bases the grid on the
boundary of the polygons rather than the convex hull of the boundary (#42).
- New dataset
memphis_precincts showing Memphis Police Department precincts,
which is required to test the new functionality of hotspot_grid().
hotspot_gistar() now extracts nearest neighbour distance from provided grid
and does not wrongly rely on (and report) an automatically generated cell
size (#38).
- Warnings about grids containing very large numbers of cells is now printed
before the cells are created, helping explain why code may be running slower
than expected (#33).
- Improved error message produced when point data and provided grid do not
overlap (#39).
- Suppressed progress bar previously included in README (#36).
sfhotspot 0.8.0 (2023-09-19)
- All functions can now handle SF objects in which the geometry column has a
name other than
geometry (#30).
hotspot_kde() progress bar is now suppressed by quiet = TRUE (#25).
- When KDE bandwidth is selected automatically based on a rule of thumb, the
reported bandwidth now takes into account the value of
bandwidth_adjust
(#32).
sfhotspot 0.7.1 (2023-02-10)
- Added warning if automatically created grids contain more than 100,000 cells,
since this can cause other functions in the package to run very slowly (#24).
- Fixed bug in which cell size could be incorrectly rounded to zero (#26).
- Removed
covr dependency.
sfhotspot 0.7.0 (2022-09-11)
- New function
hotspot_change() and corresponding methods for autoplot() and
autolayer() for measuring change in the frequency of events between two time
periods (#14).
sfhotspot 0.6.1
- Fixed bug in which the message produced when setting bandwidth automatically
referred to the unadjusted rather than adjusted bandwidth (#22).
sfhotspot 0.6.0
- New function
hotspot_dual_kde() for estimating different relations between
the density of two point layers (#1).
- New dataset
memphis_population showing the 2020 population of the centroids
of census blocks in Memphis, TN.
sfhotspot 0.5.0
- Users can now specify weights for counts of points and kernel density
estimation via the
weights argument to hotspot_count(), hotspot_kde()
and hotspot_gistar().
sfhotspot 0.4.0
- Users can now provide their own grid using the
grid argument to the
hotspot_*() family of functions.
- New function
hotspot_grid() added so users can create a rectangular or
hexagonal grid separately from counting points, calculating KDE values, etc.
This may be useful to use the same grid for different datasets covering a
similar area.
sfhotspot 0.3.1
- Fixed bug where
... arguments were not passed on to SpatialKDE::kde() as
specified in the documentation.
sfhotspot 0.3.0
- Added
autoplot() methods for plotting the results produced by
hotspot_count(), hotspot_kde() and hotspot_classify().
- Added
bandwidth_adjust argument to hotspot_kde() and hotspot_gistar() so
that bandwidth can be set relative to the default.
sfhotspot 0.2.2
- Added checking for empty geometries and co-ordinates on Null Island (or
equivalent zero co-ordinates in other co-ordinate systems). Empty geometries
produce an error and zero co-ordinates produce a warning.
sfhotspot 0.2.1
- Fixed a bug where a grid of cells could not be created for an SF object with
no CRS defined (and improved the error message when trying to calculate KDE
values in this circumstance).
- Fixed a bug where the grid returned by the
hotspot_*() family of functions
was not clipped to the convex hull of the data, as specified in the
documentation.
sfhotspot 0.2.0 (2022-02-14)
- Added
hotspot_classify() and hotspot_classify_params() functions.
- Added references to function documentation pages and the DESCRIPTION file.
- Changed
\dontrun{} in some of the documentation examples to \donttest{}.
sfhotspot 0.1.1
- Fixed a problem with some of the examples in the documentation taking too long
to run, which caused them to fail CRAN checks.
sfhotspot 0.1.0
- Initial release of the package with the functions
hotspot_count(),
hotspot_kde() and hotspot_gistar().