>>>>> Liviu Andronic <[email protected]>
>>>>> on Wed, 10 Aug 2011 11:46:55 +0200 writes:
> Hello On Wed, Aug 10, 2011 at 11:41 AM, Dimitris
> Rizopoulos <[email protected]> wrote:
>> One approach is the following:
>>
>> numVars <- sapply(iris, is.numeric) iris[numVars] <-
>> lapply(iris[numVars], round, digits = 2) head(iris)
>>
> That's interesting, but still doesn't do what I
> need. Since it's a read-only View() operation I would like
> to avoid at all cost modifying the original data
> frame. And since my data frames are relatively big, I
> would like to avoid generating unnecessary
> copies. Basically I would need round() to ignore objects
> that it knows it cannot handle.
> Any other ideas?
Well, as you say it's "View()" only, so why don't you just
"view" the result of
something like
print(<data>, digits = 2)
(it does correspond to signif(), rather than round(),
but I think that that's more sensible anyway).
Martin
______________________________________________
[email protected] 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.