Skip to content
Back to formatted view

Raw Message

Message-ID: <FEE323851BB2C840819D7A025609CF49EEE813@ex2k.bankofamerica.com>
Date: 2010-08-25T20:38:39Z
From: Gandhi, Puneet - RSCH AMRS
Subject: Question regarding floor and round

Hi All,

Is there any function in R which does what Floor or Ceiling in Excel.

Excel can take 2 arguments to FLOOR function while R doesn't.

I need the following which is done in excel

Base = 0.5
Floor(126.6,Base) = 126.5
Ceiling(126.6, Base) = 127


Base = 1
Floor(126.6, Base) = 126
Ceiling(126.6, Base) = 127

I tried round, floor, ceiling, trunc in R but none does this job. 

Pls Help/Thanks
Puneet

----------------------------------------------------------------------
This message w/attachments (message) is intended solely ...{{dropped:7}}