Skip to contents

Counts observations (and distinct scientific_name values) into cells of resolution degrees. The result has no exact coordinates, so it is the cheap way to share a distribution without publishing point locations. obs_map_density() plots this table.

Usage

obs_grid(data, resolution = 0.1, ...)

Arguments

data

An obs_df, a data frame with lat/lng, or a path to an export.

resolution

Grid resolution in degrees.

...

Passed to obs_read() when data is a path.

Value

A tibble with lng_grid, lat_grid, n, and n_species.

Examples

obs <- obs_read(obs_example_db())
obs_grid(obs, resolution = 0.05)
#> # A tibble: 149 × 4
#>    lng_grid lat_grid     n n_species
#>       <dbl>    <dbl> <int>     <int>
#>  1    -6.15     37.4   183         1
#>  2    -6        37.4   147         1
#>  3    -6.25     37.4   107         2
#>  4    -6        37.3   104         2
#>  5    -5.95     37.4    55         1
#>  6    -5.15     37.5    54         2
#>  7    -5.4      37.3    53         2
#>  8    -6.05     37.4    42         2
#>  9    -5.2      37.5    35         2
#> 10    -5.1      37.5    33         2
#> # ℹ 139 more rows