I need to present a table which is about the size of 10x4. Each cell is unknown, I would like the program to automatically catch really large numbers and display it as "Inf" or something of the sort.
Say if I define "really large" to be > 1,000,000. And with a 3x3 table example:
X, Y, Z
-1, 1, 3
-100,2,5
3,7,99999999
When printed it will display as
X, Y, Z
-1, 1, 3
-100, 2, 5
3, 7, Inf
You can implement an "override" of sorts - replacing values above a certain threshold by Inf.
This replacement will be permanent though, and will not affect only printing. The actual infinity will be stored and used for all calculations and what not.
If this is the desired behaviour consider the following toy example:
If you really only want to change the print method, you could define a new class which inherits from data.frame and then change the print method for this class. Then you will see it the way you would like to see it printed, but the object itself will not change. For example (and that might be much more involved than it could be):