Is there any way of limiting the number of digits R displays in any context? I have tried everything, including options(digits = 3)
.
Take a look at this output from my code (after calling options(digits = 3)
):
compute(NN, cbind(Test_cv[,c("Activity", "Annualised_15")], (Test_cv[, "Activity"]^2), (Test_cv[, "Annualised_15"]^2) ) )
Output:
$neurons[[2]]
[,1] [,2] [,3] [,4]
12 1 0.9999202 0.000015 0.000000000000000005288370990993990868565821639180057900375686585903167724609375000000000000000000000000000
13 1 0.9991250 0.619258 0.000000000000013876853661493364176966747169927884897333569824695587158203125000000000000000000000000000000
35 1 0.0000727 0.003018 0.032829945321210009245849192893729195930063724517822265625000000000000000000000000000000000000000000000000
Columns two and three are already too much, but column four is just insane!
scipen
is not what I want either - setting it to low values gives me scientific notation:
options(scipen = 2, digits = 3)
compute(NN, cbind(Test_cv[,c("Activity", "Annualised_15")], (Test_cv[, "Activity"]^2),
(Test_cv[, "Annualised_15"]^2) ) )
Output:
[,1] [,2] [,3] [,4]
12 1 0.9999202 0.000015 5.29e-18
13 1 0.9991250 0.619258 1.39e-14
I just want this:
[,1] [,2] [,3] [,4]
12 1 0.99 0.00 0.00
13 1 0.99 0.62 0.00
Anywhere, any time.
How do I limit this at the start of the session to stop this happening anywhere at any time without having to use round()
or signif()
or sprintf()
or formatC()
all the time and wrapping every single piece of code in one of these functions?
p.s. I haven't included a reproducible example because I'm sure lots of people have seen this kind of thing and it's a very general question.
Many, many thanks to anyone who can answer this.