Skip to content

Commit 1e7c00c

Browse files
authored
rtables not suggested (#11)
1 parent 98a396a commit 1e7c00c

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

DESCRIPTION

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: gridify
33
Title: Enrich Figures and Tables with Custom Headers and Footers and More
4-
Version: 0.7.6
4+
Version: 0.7.6.9000
55
Authors@R: c(
66
person("Maciej", "Nasinski", , "Maciej.Nasinski@ucb.com", role = c("aut", "cre")),
77
person("Alexandra", "Wall", , "Alexandra.Wall@ucb.com", role = "aut"),
@@ -37,8 +37,6 @@ Suggests:
3737
knitr,
3838
magrittr,
3939
rmarkdown,
40-
rtables (>= 0.6.15),
41-
rtables.officer,
4240
spelling,
4341
testthat (>= 3.0.0)
4442
Collate:

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# gridify 0.7.6.9000
2+
3+
* Removed `rtables` examples as installation of `rtables.officer` requires R >= 4.4.0.
4+
15
# gridify 0.7.6
26

37
* Require a new stable `rtables` version, caused by `rtables` CRAN errors.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ different inputs:
2626

2727
**grob**, **gtable**, **ggplot**, **flextable**, **gt**,
2828
**base R plots (by formula)**
29-
Whilst **rtables** are not directly supported, we can use **rtables** with `gridify` by first converting them to **flextable**.
29+
30+
Whilst **rtables** are not directly supported, we can use **rtables** with `gridify` by first converting them to **flextable** (with **rtables.officer**).
3031

3132
As `gridify` is based on the graphical tool **grid**, any figure or table
3233
inputs are converted to a `grob` object in `gridify` and the result of using

vignettes/simple_examples.Rmd

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ We will cover the use of `simple_layout()`, `complex_layout()`, `pharma_layout_b
3232
`pharma_layout_letter()`, and show how to add these layouts to `ggplot2` figures, base R figures, `flextables`, and `gt` tables.
3333

3434
`gridify` does not support `rtables` directly, but we will demonstrate how users can implement `gridify` with `rtables`
35-
by converting them to `flextables`.
35+
by converting them to `flextables` (with **rtables.officer**).
36+
3637

3738
## Examples with Figures
3839

@@ -312,7 +313,7 @@ aesthetics.
312313

313314
Here we build a simple `rtable` using the `iris` dataset.
314315

315-
```{r, message = FALSE}
316+
```{r, eval=FALSE}
316317
library(rtables)
317318
rtabl <- rtables::basic_table(main_footer = " ") %>%
318319
rtables::split_cols_by("Species") %>%
@@ -333,21 +334,21 @@ rtabl <- rtables::basic_table(main_footer = " ") %>%
333334
Then we convert the `rtable` to a `flextable` using the function `tt_to_flextable()` from the `rtables.officer` package.
334335
We specify `theme = NULL` to prevent the addition of borders which `tt_to_flextable()` adds by default.
335336

336-
```{r}
337+
```{r, eval=FALSE}
337338
library(rtables.officer)
338339
339340
ft <- rtables.officer::tt_to_flextable(rtabl, theme = NULL)
340341
```
341342

342343
Next we adjust some of the aesthetics of the `flextable`.
343344

344-
```{r}
345+
```{r, eval=FALSE}
345346
ft <- flextable::font(ft, fontname = "serif", part = "all")
346347
```
347348

348349
Finally we pass the `flextable` to `gridify()` and apply `pharma_layout_A4()`, before printing the table.
349350

350-
```{r, fig.width = 7, fig.height = 5.5}
351+
```{r, eval=FALSE, fig.width = 7, fig.height = 5.5}
351352
g <- gridify(ft, layout = pharma_layout_A4()) %>%
352353
set_cell("header_left_1", "My Company") %>%
353354
set_cell("header_left_2", "PROJECT") %>%

0 commit comments

Comments
 (0)