create_pg_indices: Create matrix with index numbering conventions as for...

Description Usage Arguments Value Examples

View source: R/pgfunctions.R

Description

Create matrix with index numbering conventions as for PRIO-GRID.

Usage

1

Arguments

ncol

The number of columns in the grid.

nrow

The number of rows in the grid.

Value

A ncol*nrow matrix with integer indices.

Examples

1
2
3
4
5
pg <- create_pg_indices(3, 3)
assertthat::are_equal(pg[1,1], (ncol*nrow)-ncol+1)
assertthat::are_equal(pg[nrow, 1], 1)
assertthat::are_equal(pg[nrow, ncol], ncol)
assertthat::are_equal(pg[1, ncol], (ncol*nrow))

prio-data/priogrid documentation built on June 28, 2021, 5:34 a.m.