Skip to contents

Convert a pgraster to tabular format

Usage

raster_to_pgtibble(r)

Arguments

r

An input raster that must have the same projection, resolution, and extent as PRIO-GRID

Value

tibble

Examples

pg <- prio_blank_grid()
names(pg) <- "test"
raster_to_pgtibble(pg)
#> Loading required package: assertthat
#> 
#> Attaching package: ‘assertthat’
#> The following object is masked from ‘package:terra’:
#> 
#>     noNA
#> Loading required package: dplyr
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:terra’:
#> 
#>     intersect, union
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union
#> # A tibble: 259,200 × 2
#>      pgid   test
#>     <int>  <int>
#>  1 258481 258481
#>  2 258482 258482
#>  3 258483 258483
#>  4 258484 258484
#>  5 258485 258485
#>  6 258486 258486
#>  7 258487 258487
#>  8 258488 258488
#>  9 258489 258489
#> 10 258490 258490
#> # ℹ 259,190 more rows