example generic R custom function call