-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathod_to_odmatrix.Rd
47 lines (44 loc) · 1.5 KB
/
od_to_odmatrix.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
46
47
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/od-funs.R
\name{od_to_odmatrix}
\alias{od_to_odmatrix}
\title{Convert origin-destination data from long to wide format}
\usage{
od_to_odmatrix(flow, attrib = 3, name_orig = 1, name_dest = 2)
}
\arguments{
\item{flow}{A data frame representing flows between origin and destinations}
\item{attrib}{A number or character string representing the column containing the attribute data
of interest from the \code{flow} data frame}
\item{name_orig}{A number or character string representing the zone of origin}
\item{name_dest}{A number or character string representing the zone of destination}
}
\description{
This function takes a data frame representing travel between origins
(with origin codes in \code{name_orig}, typically the 1st column)
and destinations
(with destination codes in \code{name_dest}, typically the second column) and returns a matrix
with cell values (from \code{attrib}, the third column by default) representing travel between
origins and destinations.
}
\examples{
od_to_odmatrix(flow)
od_to_odmatrix(flow[1:9, ])
od_to_odmatrix(flow[1:9, ], attrib = "Bicycle")
}
\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{odmatrix_to_od}()},
\code{\link{points2flow}()},
\code{\link{points2odf}()}
}
\concept{od}