Kornel's Miscellaneous R Functions