-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathod_id.Rd
62 lines (56 loc) · 1.73 KB
/
od_id.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/oneway.R
\name{od_id}
\alias{od_id}
\alias{od_id_szudzik}
\alias{od_id_max_min}
\alias{od_id_character}
\title{Combine two ID values to create a single ID number}
\usage{
od_id_szudzik(x, y, ordermatters = FALSE)
od_id_max_min(x, y)
od_id_character(x, y)
}
\arguments{
\item{x}{a vector of numeric, character, or factor values}
\item{y}{a vector of numeric, character, or factor values}
\item{ordermatters}{logical, does the order of values matter to pairing, default = FALSE}
}
\description{
Combine two ID values to create a single ID number
}
\details{
In OD data it is common to have many 'oneway' flows from "A to B" and "B to A".
It can be useful to group these an have a single ID that represents pairs of IDs
with or without directionality, so they contain 'twoway' or bi-directional values.
\verb{od_id*} functions take two vectors of equal length and return a vector of IDs,
which are unique for each combination but the same for twoway flows.
\itemize{
\item the Szudzik pairing function, on two vectors of equal
length. It returns a vector of ID numbers.
}
This function superseeds od_id_order as it is faster on large datasets
}
\examples{
(d <- od_data_sample[2:9, 1:2])
(id <- od_id_character(d[[1]], d[[2]]))
duplicated(id)
od_id_szudzik(d[[1]], d[[2]])
od_id_max_min(d[[1]], d[[2]])
}
\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_order}()},
\code{\link{od_oneway}()},
\code{\link{od_to_odmatrix}()},
\code{\link{odmatrix_to_od}()},
\code{\link{points2flow}()},
\code{\link{points2odf}()}
}
\concept{od}