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")
devtools::install_github("ctfysh/sfc")
This package is free and open source software, licensed under GPL.