[R] Rounding correction

Peter Paul Sint sint at oeaw.ac.at
Wed Jul 11 12:07:08 CEST 2001

Does anybody have R code for rounding correction for data series/arrays. 
Round and adjust such that sum remains correct.
I wrote a simple quick and dirty version which does this for one dimension (percentages). I am not yet convinced that it works o.k and the concept is right, but it solved my immediate need.

The problem is more general: ROUNDING for an array such that the margins remain correct (at least one dim margins).

Any code (also in other languages and for 1 dimension) is welcome. Otherwise a reference to the certainly known problem solutions (depending on what to optimize) would be nice.

Peter Sint
Peter Paul Sint    (sint at oeaw.ac.at, http://www.iwe.oeaw.ac.at/sint )
Institutional Change and European Integration, Austrian Academy of Sciences 
ICE,Baeckerstr.13 ,A-1010 Wien/Vienna, Austria, EU +431-51581-445(fax-566)
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list