View source: R/ordering_functions.R
order_coordinate | R Documentation |
Return the ordering of locations sorted along one of the coordinates or the sum of multiple coordinates
order_coordinate(locs, coordinate)
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 |
A vector of indices giving the ordering, i.e. the first element of this vector is the index of the first location.
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) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.