Writes one worksheet per table. This is deliberately one-way: a spreadsheet cell holds a single value, so several SeaTable column types have no faithful representation.
Details
Each sheet is named after its table, made to fit Excel's rules for
sheet names: cut to 31 characters, with each of /, \, ?, *,
: or a square bracket replaced by _. Excel compares sheet names
ignoring case, so table names that would give sheet names differing
only in the case of the letters A to Z, such as Samples and
samples, are rejected before anything is written. So is text longer
than the 32,767 characters a workbook cell holds.
What is lost
multiple-select,collaboratorandimagecells are joined with", ".filecells are reduced to their file names.linkandlink-formulacells reference rows in other tables and are exported as their display values.formulacolumns export their computed value, not the formula.geolocationcells are written as their values, in the order the source stores them, without the field names:"11.5761, 48.1371"does not say which number is the latitude.digital-signcells are written as a placeholder,"<object>", or as their bare values, depending on how the source stores them; the signature itself is not exported.buttoncolumns hold no value and are written as missing.A CSV stores numbers with 15 significant digits and a workbook with 16, so a double that needs more, such as
0.1 + 0.2, reads back very slightly different. In a CSV, date-times are written byas.character(), whose layout depends on the version of R. Usehb_write_dtable()for full precision.Views, filters, colours, column widths and every other piece of base configuration have no cell to live in.
harbouR reports which columns were flattened. To keep everything, write
a .dtable with hb_write_dtable() instead.
See also
hb_write_csv(), hb_write_dtable()
Other dtable:
as_tibble.harbour_dtable(),
hb_asset_path(),
hb_dtable(),
hb_read_csv(),
hb_read_dtable(),
hb_read_xlsx(),
hb_validate_dtable(),
hb_write_csv(),
hb_write_dtable(),
is_harbour_dtable(),
length.harbour_dtable(),
names.harbour_dtable(),
print.harbour_dtable(),
summary.harbour_dtable()
Examples
base <- hb_read_dtable(
system.file("extdata", "example.dtable", package = "harbouR")
)
out <- tempfile(fileext = ".xlsx")
hb_write_xlsx(base, out)
#> ! 7 columns were flattened to text.
#> • Samples$Tags, Samples$Collaborators, Samples$Photos, Samples$Reports,
#> Samples$Where, Samples$Action, and Samples$Signature
#> ℹ A spreadsheet cell holds one value. Use `hb_write_dtable()` to keep the
#> structure.
unlink(out)