examples/antips/R/03_make_transition_matrix.R

library(seabird2)

partition.names <- c('chick', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6nbr', 'a6sbr', 'a6fbr', 'a7nbr', 'a7sbr', 'a7fbr', 'a8nbr', 'a8sbr', 'a8fbr', 'a9nbr', 'a9sbr', 'a9fbr', 'a10nbr', 'a10sbr', 'a10fbr', 'a11nbr', 'a11sbr', 'a11fbr', 'a12nbr', 'a12sbr', 'a12fbr', 'a13nbr', 'a13sbr', 'a13fbr', 'a14nbr', 'a14sbr', 'a14fbr', 'aplusnbr', 'aplussbr', 'aplusfbr')

Tmatrix <- new("tmatrix", names = partition.names)
Tmatrix <- populate(Tmatrix, 1:5, 2:6, 'Tjuv')
Tmatrix <- populate(Tmatrix,  6,  7)
Tmatrix <- populate(Tmatrix,  6,  8)
Tmatrix <- populate(Tmatrix,  6,  9)

Tmatrix <- populate(Tmatrix,  7,  10)
Tmatrix <- populate(Tmatrix,  7,  11)
Tmatrix <- populate(Tmatrix,  7,  12)
Tmatrix <- populate(Tmatrix,  c(8, 11, 14, 17, 20, 23, 26, 29, 32, 35),  c(10, 13, 16, 19, 22, 25, 28, 31, 34, 34), 'Tsbrnbr')
Tmatrix <- populate(Tmatrix,  9,  10)
Tmatrix <- populate(Tmatrix,  9,  11)
Tmatrix <- populate(Tmatrix,  9,  12)

Tmatrix <- populate(Tmatrix, 10,  13)
Tmatrix <- populate(Tmatrix, 10,  14)
Tmatrix <- populate(Tmatrix, 10,  15)
#Tmatrix <- populate(Tmatrix, 11,  13)
Tmatrix <- populate(Tmatrix, 12,  13)
Tmatrix <- populate(Tmatrix, 12,  14)
Tmatrix <- populate(Tmatrix, 12,  15)

Tmatrix <- populate(Tmatrix, 13,  16)
Tmatrix <- populate(Tmatrix, 13,  17)
Tmatrix <- populate(Tmatrix, 13,  18)
#Tmatrix <- populate(Tmatrix, 14,  16)
Tmatrix <- populate(Tmatrix, 15,  16)
Tmatrix <- populate(Tmatrix, 15,  17)
Tmatrix <- populate(Tmatrix, 15,  18)

Tmatrix <- populate(Tmatrix, 16,  19)
Tmatrix <- populate(Tmatrix, 16,  20)
Tmatrix <- populate(Tmatrix, 16,  21)
#Tmatrix <- populate(Tmatrix, 17,  19)
Tmatrix <- populate(Tmatrix, 18,  19)
Tmatrix <- populate(Tmatrix, 18,  20)
Tmatrix <- populate(Tmatrix, 18,  21)

Tmatrix <- populate(Tmatrix, 19,  22)
Tmatrix <- populate(Tmatrix, 19,  23)
Tmatrix <- populate(Tmatrix, 19,  24)
#Tmatrix <- populate(Tmatrix, 20,  22)
Tmatrix <- populate(Tmatrix, 21,  22)
Tmatrix <- populate(Tmatrix, 21,  23)
Tmatrix <- populate(Tmatrix, 21,  24)

Tmatrix <- populate(Tmatrix, 22,  25)
Tmatrix <- populate(Tmatrix, 22,  26)
Tmatrix <- populate(Tmatrix, 22,  27)
#Tmatrix <- populate(Tmatrix, 23,  25)
Tmatrix <- populate(Tmatrix, 24,  25)
Tmatrix <- populate(Tmatrix, 24,  26)
Tmatrix <- populate(Tmatrix, 24,  27)

Tmatrix <- populate(Tmatrix, 25,  28)
Tmatrix <- populate(Tmatrix, 25,  29)
Tmatrix <- populate(Tmatrix, 25,  30)
#Tmatrix <- populate(Tmatrix, 26,  28)
Tmatrix <- populate(Tmatrix, 27,  28)
Tmatrix <- populate(Tmatrix, 27,  29)
Tmatrix <- populate(Tmatrix, 27,  30)

Tmatrix <- populate(Tmatrix, 28,  31)
Tmatrix <- populate(Tmatrix, 28,  32)
Tmatrix <- populate(Tmatrix, 28,  33)
#Tmatrix <- populate(Tmatrix, 29,  31)
Tmatrix <- populate(Tmatrix, 30,  31)
Tmatrix <- populate(Tmatrix, 30,  32)
Tmatrix <- populate(Tmatrix, 30,  33)

Tmatrix <- populate(Tmatrix, 31,  34)
Tmatrix <- populate(Tmatrix, 31,  35)
Tmatrix <- populate(Tmatrix, 31,  36)
#Tmatrix <- populate(Tmatrix, 32,  34)
Tmatrix <- populate(Tmatrix, 33,  34)
Tmatrix <- populate(Tmatrix, 33,  35)
Tmatrix <- populate(Tmatrix, 33,  36)

Tmatrix <- populate(Tmatrix, 34,  34)
Tmatrix <- populate(Tmatrix, 34,  35)
Tmatrix <- populate(Tmatrix, 34,  36)
#Tmatrix <- populate(Tmatrix, 35,  34)
Tmatrix <- populate(Tmatrix, 36,  34)
Tmatrix <- populate(Tmatrix, 36,  35)
Tmatrix <- populate(Tmatrix, 36,  36)

save(Tmatrix, file = '../data/transition_matrix.Rdata')
cttedwards/seabird2 documentation built on Feb. 5, 2018, 11:37 a.m.