Skip to content
Prev 268332 / 398502 Next

round() a data frame containing 'character' variables?

On Thu, Aug 11, 2011 at 4:58 PM, David Winsemius <dwinsemius at comcast.net> wrote:
That's a nice catch, thanks. The only problem with this approach is
that non-numeric variables are simply discarded, while I would prefer
for them to be simply ignored.
As I explained in today's reply to Martin, print(..., digits = 2) and
format(..., digits = 2) both display a "minimal number of
_significant_ digits". However, for various reasons, I need to specify
the "number of decimal places" as in round(..., digits = 2). Both
print() and format() don't provide an obvious way to do that.

Regards
Liviu