random assortment of small R scripts - isolate functions and examples