lu's useful R functions for work