Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/BioGeoBEARS_generics_v1.R
When a table has numbers that range over many orders of magnitude, it can be very distracting if the display program forces each column to the same format. This function formats a cell much like Excel would.
1 2 3 4 5 6 | conditional_format_cell(cellval,
numbers_below_this_get_scientific = 1e-04,
numdigits_for_superlow_scientific = 1,
numbers_above_this_get_scientific = 1e+07,
numdigits_for_superhigh_scientific = 2,
numdigits_inbetween_have_fixed_digits = 4)
|
cellval |
The cell value to format. |
numbers_below_this_get_scientific |
When the absolute value of a number is below this value, scientific notation is used. |
numdigits_for_superlow_scientific |
Number of digits after the '.' for scientific notation of small numbers. |
numbers_above_this_get_scientific |
When the absolute value of a number is above this value, scientific notation is used. |
numdigits_for_superhigh_scientific |
Number of digits after the '.' for scientific notation of large numbers. |
numdigits_inbetween_have_fixed_digits |
Numbers of
medium size have this many fixed digits. Note that other
cutoffs are specified in the code, and
|
The defaults seem to work well, but could be modified. The current function also extracts just the filename, if a full path is given.
cellval
The value, reformatted and of class
character
.
Go BEARS!
Nicholas J. Matzke matzke@berkeley.edu
http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster
Matzke_2012_IBS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | test=1
cellval = 143514514514532
conditional_format_cell(cellval)
cellval = -42.235235
conditional_format_cell(cellval)
cellval = -42.0000000
conditional_format_cell(cellval)
cellval = 0.0000
conditional_format_cell(cellval)
cellval = 0.0001
conditional_format_cell(cellval)
cellval = 0.00001
conditional_format_cell(cellval)
cellval = 0.0000111
conditional_format_cell(cellval)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.