# NOT RUN {
##########################
# The base feedback loop #
##########################
data(toy.IO)
class(toy.IO)
fbl = feedback.loop(toy.IO)
fbl$loop_1
fl_3 = feedback.loop.matrix(fbl, 3)
heatmap.io(fl_3, RS_label = toy.IO$RS_label)
fbl$value
fbl$per = fbl$value / sum(fbl$value) * 100
obj = data.frame(x = 1:length(fbl$per), y = fbl$per)
ggplot(obj, aes(x = x, y = y)) +
geom_line() + geom_point() +
labs(x = 'Loop', y = 'Percent', title = 'Proportion of Total Intermediate Transactions per Loop')
###############################
# An aggregated feedback loop #
###############################
fbl_agg = feedback.loop(toy.IO, agg.regions = TRUE)
io_agg = agg.region(toy.IO, regions = 'all', newname = 'magic')
fl_agg_1 = feedback.loop.matrix(fbl_agg, loop = 1)
heatmap.io(fl_agg_1, RS_label = io_agg$RS_label)
# }
Run the code above in your browser using DataLab