The file is written in the layout that read.sheet reads: a
header row of the year column's name followed by the series IDs,
then one row per year.
Precision
prec controls how many decimal places are written. Left at
NULL it is taken from the "dplR.provenance" attribute that
read.sheet and read.tucson attach to the objects
they return, and failing that it is inferred from the data. This is what
keeps a width read at 0.001 mm from being written back as
0.5670000000000001.
A precision that was derived rather than given is checked against the data
before it is used, and if rounding there would discard real digits the file
is written at full precision with a warning instead. A precision passed
explicitly is an instruction and is obeyed, so prec = 0.1 rounds.
Trailing zeros are kept: at prec = 0.001 a width of 0.51 is
written as 0.510.
A ring width of zero is a locally absent ring and is written as a zero. A
missing value is written as na.string. The two are different statements
about a tree in a year and are never written the same way.
Series IDs are written verbatim. An ID containing the
separator, a double quote or a line break is quoted using the usual
comma-separated-value escape.