The R package sfc is a tool for substance flow computation, which can finally be used in substance flow analysis (SFA).
You can use devtools to install the development version from Github:
install.packages("devtools")
::install_github("ctfysh/sfc") devtools
This package is free and open source software, licensed under GPL.