R programs for using OF API