# Getting started

forgts leverages readxl, tidyxl, and unheadr to read a spreadsheet and its formatting information and produce a gt object with the same cell and text formatting as the input file.

The main function in this package is `forgts::forgts()`, which simply takes path to an xlsx file and an optional sheet number.

The text and cell formats currently supported include:

- font face (bold, italic)
- font style (color, underline, strikethrough)
- cell fill
- cell borders (color and width)

Please note that formatting in the headers is ignored intentionally in this package, and that the cell and text formatting is added iteratively on top of gt defaults. The gt object produced can be styled further or exported.

forgts ships with an example spreadsheet file (`rodentsheet.xlsx`) that looks like this:

The function `forgts()` will read the file and produce a gt object.

    library(forgts)
    ###
    example_spreadsheet <- system.file("extdata/rodentsheet.xlsx", package = "forgts")

    forgts(example_spreadsheet)

measurement type | species | sex | CBL | LR
--- | --- | --- | --- | ---
craniodental | Abeomelomys sevia | m | 30.10 | 9.65
craniodental | Bandicota bengalensis | f | 39.41 | 11.21
craniodental | Chiruromys forbesi | m | 30.73 | 8.27
craniodental | Chiruromys forbesi | m | 34.46 | 8.13
craniodental | Chiruromys lamia | m | 29.56 | 8.13
craniodental | Chiruromys lamia | m | 27.45 | 7.13
craniodental | Chiruromys vates | m | 28.70 | 7.04

    # note that the resulting gt is responsive to dark and light modes on a browser

`forgts()` may be used in RMarkdown and Quarto documents, and the resulting gt tables may be exported with `gt::gtsave()`.