R LanguageWriting functions in R