Dear R-Experts, how can I divide the number 0.285 with 2. I need a function. Result: 0.285 / 2 = 0.1425 Thanks, Corinna
Well, i think half.of.0.285 <- function() { 0.1425 } would do the trink. Gabor On Wed, Apr 18, 2007 at 04:42:49PM +0200, Schmitt, Corinna wrote:> Dear R-Experts, > > how can I divide the number 0.285 with 2. I need a function. > Result: 0.285 / 2 = 0.1425 > > Thanks, Corinna > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Csardi Gabor <csardi at rmki.kfki.hu> MTA RMKI, ELTE TTK
Schmitt, Corinna wrote:> Dear R-Experts, > > how can I divide the number 0.285 with 2. I need a function. > Result: 0.285 / 2 = 0.1425Just get the / operator: > divide = get("/") > > divide(0.285,2) [1] 0.1425 Is that what you want? Barry
On Wed, 2007-04-18 at 16:06 +0100, Barry Rowlingson wrote:> Schmitt, Corinna wrote: > > Dear R-Experts, > > > > how can I divide the number 0.285 with 2. I need a function. > > Result: 0.285 / 2 = 0.1425 > > Just get the / operator: > > > divide = get("/") > > > > divide(0.285,2) > [1] 0.1425 > > Is that what you want? > > BarryYou can use the function directly, by quoting it:> "/"(0.285, 2)[1] 0.1425 G -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [t] +44 (0)20 7679 0522 ECRC & ENSIS, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/cv/ London, UK. WC1E 6BT. [w] http://www.ucl.ac.uk/~ucfagls/ %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%