| dgearthstat | R Documentation |
Calculates statistics about the hexagonal grid at the current resolution, including total number of cells, cell area, and cell spacing.
dgearthstat(dggs)
dggs |
Grid specification from hexify_grid() |
List with components:
area_km |
Total Earth surface area in km^2 |
n_cells |
Total number of cells at this resolution |
cell_area_km2 |
Average cell area in km^2 |
cell_spacing_km |
Average distance between cell centers in km |
resolution |
Resolution level |
aperture |
Grid aperture |
Other grid statistics:
dg_closest_res_to_area(),
hexify_area_to_eff_res(),
hexify_compare_resolutions(),
hexify_eff_res_to_area(),
hexify_eff_res_to_resolution(),
hexify_resolution_to_eff_res()
grid <- hexify_grid(area = 1000, aperture = 3)
stats <- dgearthstat(grid)
print(sprintf("Resolution %d has %.0f cells",
stats$resolution, stats$n_cells))
print(sprintf("Average cell area: %.2f km^2",
stats$cell_area_km2))
print(sprintf("Average cell spacing: %.2f km",
stats$cell_spacing_km))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.