-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathodmatrix_to_od.Rd
45 lines (45 loc) · 1.32 KB
/
odmatrix_to_od.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/od-funs.R
\name{odmatrix_to_od}
\alias{odmatrix_to_od}
\title{Convert origin-destination data from wide to long format}
\usage{
odmatrix_to_od(odmatrix)
}
\arguments{
\item{odmatrix}{A matrix with row and columns representing origin and destination zone codes
and cells representing the flow between these zones.}
}
\description{
This function takes a matrix representing travel between origins
(with origin codes in the \code{rownames} of the matrix)
and destinations
(with destination codes in the \code{colnames} of the matrix)
and returns a data frame representing origin-destination pairs.
}
\details{
The function returns a data frame with rows ordered by origin and then destination
zone code values and with names \code{orig}, \code{dest} and \code{flow}.
}
\examples{
odmatrix <- od_to_odmatrix(flow)
odmatrix_to_od(odmatrix)
flow[1:9, 1:3]
odmatrix_to_od(od_to_odmatrix(flow[1:9, 1:3]))
}
\seealso{
Other od:
\code{\link{od2line}()},
\code{\link{od2odf}()},
\code{\link{od_aggregate_from}()},
\code{\link{od_aggregate_to}()},
\code{\link{od_coords}()},
\code{\link{od_coords2line}()},
\code{\link{od_id}},
\code{\link{od_id_order}()},
\code{\link{od_oneway}()},
\code{\link{od_to_odmatrix}()},
\code{\link{points2flow}()},
\code{\link{points2odf}()}
}
\concept{od}