Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotspot_gistar() reports automatically selected cell size even when grid is provided #38

Closed
mpjashby opened this issue Mar 20, 2024 · 1 comment
Assignees
Labels
bug Something isn't working fixed in dev

Comments

@mpjashby
Copy link
Owner

Describe the bug
hotspot_gistar() reports automatically selected cell size even when grid is provided

To Reproduce

library(sfhotspot)

memphis_grid <- memphis_population |> 
  sf::st_transform("EPSG:2843") |> 
  hotspot_grid(cell_size = 500)

memphis_gistar <- memphis_robberies_jan |> 
  sf::st_transform("EPSG:2843") |> 
  hotspot_gistar(kde = FALSE, grid = memphis_grid)
#> Cell size set to 500 metres automatically

Created on 2024-03-20 with reprex v2.1.0

Expected behavior
A message reporting the automatically selected value of cell_size should only be produced when grid and cell_size are NULL.

@mpjashby mpjashby added the bug Something isn't working label Mar 20, 2024
@mpjashby mpjashby self-assigned this Mar 20, 2024
@mpjashby
Copy link
Owner Author

This is specific to hotspot_gistar() because in other other functions create_grid() is only called if the grid argument is NULL, but for hotspot_gistar() the grid is calculated first before being used to calculate both KDE and GI* values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in dev
Projects
None yet
Development

No branches or pull requests

1 participant