make_adjacency_matrix: Convert station data to adjacency matrix

Description Usage Arguments Examples

View source: R/matrix.R

Description

Convert station data to adjacency matrix

Usage

1
make_adjacency_matrix(stations, depart, arrive)

Arguments

stations

data.frame which set of stopping points recorded in order of stopping.

depart

Column name of a stop.

arrive

Give the name of the column indicating the next stop at the target stop.

Examples

1
make_adjacency_matrix(jreast_jt, st_code, next_st_code)

Example output

      00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112
00101     0     1     0     0     0     0     0     0     0     0     0     0
00102     1     0     1     0     0     0     0     0     0     0     0     0
00103     0     1     0     1     0     0     0     0     0     0     0     0
00104     0     0     1     0     1     0     0     0     0     0     0     0
00105     0     0     0     1     0     1     0     0     0     0     0     0
00106     0     0     0     0     1     0     1     0     0     0     0     0
00107     0     0     0     0     0     1     0     1     0     0     0     0
00108     0     0     0     0     0     0     1     0     1     0     0     0
00109     0     0     0     0     0     0     0     1     0     1     0     0
00110     0     0     0     0     0     0     0     0     1     0     1     0
00111     0     0     0     0     0     0     0     0     0     1     0     1
00112     0     0     0     0     0     0     0     0     0     0     1     0
00113     0     0     0     0     0     0     0     0     0     0     0     1
00114     0     0     0     0     0     0     0     0     0     0     0     0
00115     0     0     0     0     0     0     0     0     0     0     0     0
00116     0     0     0     0     0     0     0     0     0     0     0     0
00117     0     0     0     0     0     0     0     0     0     0     0     0
00118     0     0     0     0     0     0     0     0     0     0     0     0
00119     0     0     0     0     0     0     0     0     0     0     0     0
00120     0     0     0     0     0     0     0     0     0     0     0     0
      00113 00114 00115 00116 00117 00118 00119 00120
00101     0     0     0     0     0     0     0     0
00102     0     0     0     0     0     0     0     0
00103     0     0     0     0     0     0     0     0
00104     0     0     0     0     0     0     0     0
00105     0     0     0     0     0     0     0     0
00106     0     0     0     0     0     0     0     0
00107     0     0     0     0     0     0     0     0
00108     0     0     0     0     0     0     0     0
00109     0     0     0     0     0     0     0     0
00110     0     0     0     0     0     0     0     0
00111     0     0     0     0     0     0     0     0
00112     1     0     0     0     0     0     0     0
00113     0     1     0     0     0     0     0     0
00114     1     0     1     0     0     0     0     0
00115     0     1     0     1     0     0     0     0
00116     0     0     1     0     1     0     0     0
00117     0     0     0     1     0     1     0     0
00118     0     0     0     0     1     0     1     0
00119     0     0     0     0     0     1     0     1
00120     0     0     0     0     0     0     1     0

ssrn documentation built on July 1, 2020, 10:22 p.m.