R functions related to various projects