order_coordinate {GPvecchia} | R Documentation |
Sorted coordinate ordering
Description
Return the ordering of locations sorted along one of the coordinates or the sum of multiple coordinates
Usage
order_coordinate(locs, coordinate)
Arguments
locs |
A matrix of locations. Each row of |
coordinate |
integer or vector of integers in {1,...,d}. If a single integer,
coordinates are ordered along that coordinate. If multiple integers,
coordinates are ordered according to the sum of specified coordinate values. For example,
when |
Value
A vector of indices giving the ordering, i.e. the first element of this vector is the index of the first location.
Examples
n <- 100 # Number of locations
d <- 2 # dimension of domain
locs <- matrix( runif(n*d), n, d )
ord1 <- order_coordinate(locs, 1 )
ord12 <- order_coordinate(locs, c(1,2) )