forked from rstudio/gt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_pkgdown.yml
245 lines (230 loc) · 8.67 KB
/
_pkgdown.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
url: https://gt.rstudio.com
home:
strip_header: true
reference:
- title: Create Table
desc: >
<a href="https://rstudio.cloud/project/159889">
<img src="https://github.com/rstudio/gt/raw/master/man/figures/rstudio-cloud-example.png" alt="RStudio Cloud Example" width="180px">
</a>
<br /><br />
All **gt** tables begin with a call to `gt()`, where we would supply the
input data table (data frame or tibble) and some basic options for
creating a stub (`rowname_col`) and row groups (`groupname_col`). We
can also introduce a grouped tibble (via **dplyr**'s `group_by()`) for
more precise divisions of rows into row groups. The `gt_preview()`
function is great for getting a nicely-formatted preview of a data
table (defaulting to the first 5 rows and the last row).
contents:
- gt
- gt_preview
- title: Create/Modify Parts
desc: >
<a href="https://rstudio.cloud/project/160008">
<img src="https://github.com/rstudio/gt/raw/master/man/figures/rstudio-cloud-example.png" alt="RStudio Cloud Example" width="180px">
</a>
<br /><br />
A **gt** table can contain a few useful parts for conveying additional
information. These include a header (with a titles and subtitle), a
footer (with footnotes and source notes), and additional areas for
labels (row group labels, column spanner labels, the stubhead label).
We can modify the look of table parts more generally with
`tab_options()` and perform styling on targeted table locations with
`tab_style()`
contents:
- tab_header
- tab_spanner
- tab_row_group
- tab_stubhead_label
- tab_footnote
- tab_source_note
- tab_options
- tab_style
- title: Format Data
desc: >
<a href="https://rstudio.cloud/project/160011">
<img src="https://github.com/rstudio/gt/raw/master/man/figures/rstudio-cloud-example.png" alt="RStudio Cloud Example" width="180px">
</a>
<br /><br />
Columns of data can be formatted with the `fmt_*()` functions. We can
specify the rows of these columns quite precisely with the `rows`
argument. We get to apply these functions exactly once to each data
cell (last call wins). Need to do custom formatting? Use the `fmt()`
function and define your own formatter within (or, create a wrapper
with `fmt()` if you prefer). The `text_transform()` function allows
for post-processing of any data, and we provide a function for that
transformation.
contents:
- fmt
- fmt_number
- fmt_scientific
- fmt_percent
- fmt_currency
- fmt_date
- fmt_time
- fmt_datetime
- fmt_missing
- fmt_passthrough
- text_transform
- data_color
- title: Modify Columns
desc: >
<a href="https://rstudio.cloud/project/160017">
<img src="https://github.com/rstudio/gt/raw/master/man/figures/rstudio-cloud-example.png" alt="RStudio Cloud Example" width="180px">
</a>
<br /><br />
The `cols_*()` functions allow for modifications that act on entire
columns. This includes alignment of the data in columns
(`cols_align()`), hiding columns from view (`cols_hide()`),
re-labeling the column labels (`cols_label()`), merging two columns
together (`cols_merge*()`), moving columns around (`cols_move*()`),
and using a column name delimiter to create labels in the column
spanner (`cols_split_delim()`).
contents:
- cols_align
- cols_hide
- cols_label
- cols_merge
- cols_merge_range
- cols_merge_uncert
- cols_move
- cols_move_to_end
- cols_move_to_start
- cols_split_delim
- title: Modify Rows
desc: >
<a href="https://rstudio.cloud/project/160465">
<img src="https://github.com/rstudio/gt/raw/master/man/figures/rstudio-cloud-example.png" alt="RStudio Cloud Example" width="180px">
</a>
<br /><br />
The only function currently that modifies entire rows is the
`row_group_order()` function. It lets us modify the ordering of any
row groups in the table.
contents:
- row_group_order
- title: Add Rows
desc: >
<a href="https://rstudio.cloud/project/160468">
<img src="https://github.com/rstudio/gt/raw/master/man/figures/rstudio-cloud-example.png" alt="RStudio Cloud Example" width="180px">
</a>
<br /><br />
There is one function that will add rows to a **gt** table and that
is the `summary_rows()` function. It's useful for adding summary rows
to any table that has row groups and a stub (which is required for
summary row labels).
contents:
- summary_rows
- title: Export Table
desc: >
<a href="https://rstudio.cloud/project/174361">
<img src="https://github.com/rstudio/gt/raw/master/man/figures/rstudio-cloud-example.png" alt="RStudio Cloud Example" width="180px">
</a>
<br /><br />
There may come a day when you need to export a **gt** table to some
specific format. We have functions for getting the HTML content of
a **gt** table (`as_raw_html()`), getting LaTeX code (`as_latex()`),
and getting rich text (`as_rtf()`). Did you use the `summary_rows()`
function and wish you had that summary data in a tibble? You can get
it out with `extract_summary()`.
contents:
- as_raw_html
- as_latex
- as_rtf
- extract_summary
- title: Shiny Functions
desc: >
Shiny is great for building interactive web apps with R. There's
really nothing quite like it. The **gt** package includes two
functions that work nicely with Shiny: a table render function
`render_gt()` (for the `server`) and a table output element
`gt_output()` (for the `ui`).
contents:
- render_gt
- gt_output
- title: Helper Functions
desc: >
A small assortment of helper functions is available in the **gt**
package. The various `cells_*()` functions are used for targeting
cells with the `locations` argument in the `tab_footnote()`,
`tab_style()`, and `text_transform()` functions. The `cells_styles()`
function is used exclusively with `tab_style()`'s `style` argument
(and the `px()` & `pct()` functions may be useful there for specifying
units in pixels or percentages). The `md()` and `html()` helpers can
used be during label creation with the `tab_header()`,
`tab_footnote()`, `tab_spanner()`, `tab_stubhead_label()`, and
`tab_source_note()` functions.
contents:
- location_cells
- cells_styles
- vars
- md
- html
- px
- pct
- escape_latex
- adjust_luminance
- title: Image Addition
desc: >
<a href="https://rstudio.cloud/project/161121">
<img src="https://github.com/rstudio/gt/raw/master/man/figures/rstudio-cloud-example.png" alt="RStudio Cloud Example" width="180px">
</a>
<br /><br />
We can add images into a **gt** table with the help of the `*_image()`
functions. Two common ways to do this: (1) use `text_transform()` to
insert images into data cells, (2) use any function that creates
new labels (e.g., `tab_header()`) and use a `*_image()` function
within the `html()` helper.
contents:
- web_image
- local_image
- ggplot_image
- test_image
- title: Information
desc: >
These `info_*()` functions present us with **gt** tables containing
useful information. So far, we can get reference information on
date styles (`info_date_style()`), on time styles
(`info_time_style()`), on a huge number of color palettes
(`info_paletteer()`), and, on currencies (`info_currencies()`).
contents:
- info_date_style
- info_time_style
- info_paletteer
- info_currencies
- title: Datasets
desc: >
The **gt** package is equipped with six datasets. Use them to
experiment with the API, they come in all shapes and sizes. Many
examples in the internal help documents use these datasets to
quickly demonstrate key features of **gt**.
contents:
- countrypops
- sza
- gtcars
- sp500
- pizzaplace
- exibble
navbar:
type: default
left:
- text: Intro
href: articles/intro-creating-gt-tables.html
- text: Reference
href: reference/index.html
- text: Articles
menu:
- text: How to Use
- text: gt Datasets
href: articles/gt-datasets.html
- text: Summary Lines
href: articles/creating-summary-lines.html
- text: Case Studies
- text: 'Case Study: gtcars'
href: articles/case-study-gtcars.html
- text: News
href: news/index.html
right:
- icon: fa-github fa-lg
href: https://github.com/rstudio/gt
development:
mode: unreleased