Skip to content

Commit

Permalink
reduced png file size with cavif to remove note from R cmd check.
Browse files Browse the repository at this point in the history
  • Loading branch information
mduncans committed Oct 31, 2024
1 parent 6eb357b commit 8fe4fb2
Show file tree
Hide file tree
Showing 82 changed files with 33 additions and 33 deletions.
16 changes: 8 additions & 8 deletions vignettes/Integrating_reportifyr_into_report_writing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ If you'd like more detail on the initialization of `reportifyr`, please see the

To build reports with `reportifyr` you need to insert a figure or table caption using the 'Insert Caption' button under the 'References' ribbon.

![](data/images/insert_caption.png){width=100%}
![](data/images/insert_caption.avif){width=100%}

This will insert a caption (either figure or table) into the Microsoft Word document. Underneath that caption, you need to add:

Expand All @@ -123,7 +123,7 @@ This string triggers the magic behind `reportifyr`, and inserts the figure or ta

In the [vignette on integrating reportifyr into analyses](Integrating_reportifyr_into_analyses.html), we saved two figures and two tables. In the template Microsoft Word document packaged with `reportifyr`, figure and table captions, and their associated magic strings to allow insertion of figures/tables and footnotes, have already been inserted. Below is an image of the caption and magic string for the concentration time profile figure we generated:

![](data/images/figure-2_caption_and_magic_string.png){width=100%}
![](data/images/figure-2_caption_and_magic_string.avif){width=100%}

We can now perform some setup and start filling in the template! The first thing we'll do is assign the input and output document names. We will be populating the `template.docx` which contains no figures or tables inserted by `reportifyr`. If the input document does contain `reportifyr` inserted objects, you'll need to remove them with `remove_tables_figures_footnotes` first.

Expand Down Expand Up @@ -159,7 +159,7 @@ add_tables(docx_in = doc_dirs$doc_clean,

We can see the tables were successfully inserted:

![](data/images/table_2_in_doc.png){width=100%}
![](data/images/table_2_in_doc.avif){width=100%}

Now that the tables are inserted, we can insert the figures:

Expand All @@ -173,7 +173,7 @@ add_plots(docx_in = doc_dirs$doc_tables,

And now we can see our figures in the document as well:

![](data/images/figure_2_in_doc.png){width=100%}
![](data/images/figure_2_in_doc.avif){width=100%}

Now we can add the footnotes:

Expand All @@ -189,8 +189,8 @@ add_footnotes(docx_in = doc_dirs$doc_tabs_figs,

We now can see our figures and tables have footnotes inserted:

![](data/images/fig_2_with_fn.png){width=100%}
![](data/images/table_2_with_fn.png){width=100%}
![](data/images/fig_2_with_fn.avif){width=100%}
![](data/images/table_2_with_fn.avif){width=100%}

Now that all the elements are inserted, we can generate a clean final report. This severs the link between `reportifyr` and the document, so please be careful using this function:

Expand All @@ -203,8 +203,8 @@ finalize_document(docx_in = doc_dirs$doc_draft,

This creates a finalized document, free of magic strings, while also capturing the metadata for this final document. The metadata includes a file hash so you can see if this document has been updated since its creation.

![](data/images/fig_2_final.png){width=100%}
![](data/images/table_2_final.png){width=100%}
![](data/images/fig_2_final.avif){width=100%}
![](data/images/table_2_final.avif){width=100%}

```{r remove directories, include = FALSE}
unlink(file.path(here::here(), "vignettes", ".venv"), recursive = TRUE)
Expand Down
Binary file added vignettes/data/images/bookmarks_reference.avif
Binary file not shown.
Binary file removed vignettes/data/images/bookmarks_reference.png
Binary file not shown.
Binary file added vignettes/data/images/fig1_update.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig1_update.png
Binary file not shown.
Binary file added vignettes/data/images/fig2_fn_ef_draft.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig2_fn_ef_draft.png
Binary file not shown.
Binary file added vignettes/data/images/fig2_no_fn_ef.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig2_no_fn_ef.png
Binary file not shown.
Binary file added vignettes/data/images/fig2_op_fn_ef_draft.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig2_op_fn_ef_draft.png
Binary file not shown.
Binary file added vignettes/data/images/fig2_update.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig2_update.png
Binary file not shown.
Binary file added vignettes/data/images/fig3_fn_ef_draft.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig3_fn_ef_draft.png
Binary file not shown.
Binary file added vignettes/data/images/fig3_no_fn_ef.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig3_no_fn_ef.png
Binary file not shown.
Binary file added vignettes/data/images/fig3_op_fn_ef_draft.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig3_op_fn_ef_draft.png
Binary file not shown.
Binary file added vignettes/data/images/fig3_update.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig3_update.png
Binary file not shown.
Binary file added vignettes/data/images/fig4_no_fn_ef_draft.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig4_no_fn_ef_draft.png
Binary file not shown.
Binary file added vignettes/data/images/fig4_no_fn_template.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig4_no_fn_template.png
Binary file not shown.
Binary file added vignettes/data/images/fig4_op_no_fn_ef_draft.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig4_op_no_fn_ef_draft.png
Binary file not shown.
Binary file added vignettes/data/images/fig_2_final.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig_2_final.png
Binary file not shown.
Binary file added vignettes/data/images/fig_2_with_fn.avif
Binary file not shown.
Binary file removed vignettes/data/images/fig_2_with_fn.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added vignettes/data/images/figure_1_in_doc.avif
Binary file not shown.
Binary file removed vignettes/data/images/figure_1_in_doc.png
Binary file not shown.
Binary file added vignettes/data/images/figure_1_with_fn.avif
Binary file not shown.
Binary file removed vignettes/data/images/figure_1_with_fn.png
Binary file not shown.
Binary file added vignettes/data/images/figure_2_in_doc.avif
Binary file not shown.
Binary file removed vignettes/data/images/figure_2_in_doc.png
Binary file not shown.
Binary file added vignettes/data/images/insert_caption.avif
Binary file not shown.
Binary file removed vignettes/data/images/insert_caption.png
Binary file not shown.
Binary file added vignettes/data/images/no_bk_ms.avif
Binary file not shown.
Binary file removed vignettes/data/images/no_bk_ms.png
Binary file not shown.
Binary file added vignettes/data/images/removed_bookmarks.avif
Binary file not shown.
Binary file removed vignettes/data/images/removed_bookmarks.png
Binary file not shown.
Binary file added vignettes/data/images/tab1_fn_ef_draft.avif
Binary file not shown.
Binary file removed vignettes/data/images/tab1_fn_ef_draft.png
Binary file not shown.
Binary file added vignettes/data/images/tab1_no_fn_ef.avif
Binary file not shown.
Binary file removed vignettes/data/images/tab1_no_fn_ef.png
Binary file not shown.
Binary file added vignettes/data/images/tab1_op_fn_ef_draft.avif
Binary file not shown.
Binary file removed vignettes/data/images/tab1_op_fn_ef_draft.png
Diff not rendered.
Binary file added vignettes/data/images/tab1_update.avif
Binary file not shown.
Binary file removed vignettes/data/images/tab1_update.png
Diff not rendered.
Binary file added vignettes/data/images/tab2_fn_ef_draft.avif
Binary file not shown.
Binary file removed vignettes/data/images/tab2_fn_ef_draft.png
Diff not rendered.
Binary file added vignettes/data/images/tab2_no_fn_ef.avif
Binary file not shown.
Binary file removed vignettes/data/images/tab2_no_fn_ef.png
Diff not rendered.
Binary file added vignettes/data/images/tab2_op_fn_ef_draft.avif
Binary file not shown.
Binary file removed vignettes/data/images/tab2_op_fn_ef_draft.png
Diff not rendered.
Binary file added vignettes/data/images/tab2_update.avif
Binary file not shown.
Binary file removed vignettes/data/images/tab2_update.png
Diff not rendered.
Binary file added vignettes/data/images/tab3_update.avif
Binary file not shown.
Binary file removed vignettes/data/images/tab3_update.png
Diff not rendered.
Binary file added vignettes/data/images/tab4_no_fn_ef_draft.avif
Binary file not shown.
Binary file removed vignettes/data/images/tab4_no_fn_ef_draft.png
Diff not rendered.
Binary file added vignettes/data/images/tab4_no_fn_template.avif
Binary file not shown.
Binary file removed vignettes/data/images/tab4_no_fn_template.png
Diff not rendered.
Binary file not shown.
Binary file removed vignettes/data/images/tab4_op_no_fn_ef_draft.png
Diff not rendered.
Binary file added vignettes/data/images/table_2_final.avif
Binary file not shown.
Binary file removed vignettes/data/images/table_2_final.png
Diff not rendered.
Binary file added vignettes/data/images/table_2_in_doc.avif
Binary file not shown.
Binary file removed vignettes/data/images/table_2_in_doc.png
Diff not rendered.
Binary file added vignettes/data/images/table_2_with_fn.avif
Binary file not shown.
Binary file removed vignettes/data/images/table_2_with_fn.png
Diff not rendered.
Binary file added vignettes/data/images/tfn_wrapper.avif
Binary file not shown.
Binary file removed vignettes/data/images/tfn_wrapper.png
Diff not rendered.
36 changes: 18 additions & 18 deletions vignettes/elective_footnotes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ build_report(docx_in = docx_shell,
```

This produces a report without footnotes in the entire document.
![fig2 no fn](data/images/fig2_no_fn_ef.png){width=100%}
![fig3 no fn](data/images/fig3_no_fn_ef.png){width=100%}
![tab1 no fn](data/images/tab1_no_fn_ef.png){width=100%}
![tab2 no fn](data/images/tab2_no_fn_ef.png){width=100%}
![fig2 no fn](data/images/fig2_no_fn_ef.avif){width=100%}
![fig3 no fn](data/images/fig3_no_fn_ef.avif){width=100%}
![tab1 no fn](data/images/tab1_no_fn_ef.avif){width=100%}
![tab2 no fn](data/images/tab2_no_fn_ef.avif){width=100%}

If we instead want to include an appendix figure and table without footnotes,
but want footnotes within the rest of the report we can use the
Expand Down Expand Up @@ -206,8 +206,8 @@ result <- file.copy(from = system.file("extdata/template-ef.docx", package = "re
to = file.path(here::here(), "vignettes", "report", "shell", "template-ef.docx"))
```

![fig4 no fn template](data/images/fig4_no_fn_template.png){width=100%}
![tab4 no fn template](data/images/tab4_no_fn_template.png){width=100%}
![fig4 no fn template](data/images/fig4_no_fn_template.avif){width=100%}
![tab4 no fn template](data/images/tab4_no_fn_template.avif){width=100%}


```{r}
Expand All @@ -230,12 +230,12 @@ build_report(docx_in = docx_shell,
)
```

![](data/images/fig2_fn_ef_draft.png){width=100%}
![](data/images/fig3_fn_ef_draft.png){width=100%}
![](data/images/fig4_no_fn_ef_draft.png){width=100%}
![](data/images/tab1_fn_ef_draft.png){width=100%}
![](data/images/tab2_fn_ef_draft.png){width=100%}
![](data/images/tab4_no_fn_ef_draft.png){width=100%}
![](data/images/fig2_fn_ef_draft.avif){width=100%}
![](data/images/fig3_fn_ef_draft.avif){width=100%}
![](data/images/fig4_no_fn_ef_draft.avif){width=100%}
![](data/images/tab1_fn_ef_draft.avif){width=100%}
![](data/images/tab2_fn_ef_draft.avif){width=100%}
![](data/images/tab4_no_fn_ef_draft.avif){width=100%}

We can see in the logs that theoph-pk-demographics.csv was missing metadata and
that default formatting was applied. We additionally see warnings about missing
Expand Down Expand Up @@ -267,12 +267,12 @@ build_report(docx_in = docx_shell,
)
```

![](data/images/fig2_op_fn_ef_draft.png){width=100%}
![](data/images/fig3_op_fn_ef_draft.png){width=100%}
![](data/images/fig4_op_no_fn_ef_draft.png){width=100%}
![](data/images/tab1_op_fn_ef_draft.png){width=100%}
![](data/images/tab2_op_fn_ef_draft.png){width=100%}
![](data/images/tab4_op_no_fn_ef_draft.png){width=100%}
![](data/images/fig2_op_fn_ef_draft.avif){width=100%}
![](data/images/fig3_op_fn_ef_draft.avif){width=100%}
![](data/images/fig4_op_no_fn_ef_draft.avif){width=100%}
![](data/images/tab1_op_fn_ef_draft.avif){width=100%}
![](data/images/tab2_op_fn_ef_draft.avif){width=100%}
![](data/images/tab4_op_no_fn_ef_draft.avif){width=100%}


```{r remove directories, include = FALSE}
Expand Down
2 changes: 1 addition & 1 deletion vignettes/streamlined_reportifyr_workflow.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ build_report(docx_in = docx_shell,
This produces the same `reportifyr` draft as does the step-wise process, but with
only a single function call.

![](data/images/tfn_wrapper.png)
![](data/images/tfn_wrapper.avif)

And we can remove the magic strings and bookmarks with the same `finalize_document`
function:
Expand Down
12 changes: 6 additions & 6 deletions vignettes/update_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,17 @@ build_report(docx_in = docx_old,
We can see that figures 2 and 3 were updated, and table 2 was updated, while
table 1 and the non-`reportifyr` content were unaltered:

![Figure 1 is unaltered](data/images/fig1_update.png){width=100%}
![Figure 1 is unaltered](data/images/fig1_update.avif){width=100%}

![Figure 2 is updated](data/images/fig2_update.png){width=100%}
![Figure 2 is updated](data/images/fig2_update.avif){width=100%}

![Figure 3 is updated](data/images/fig3_update.png){width=100%}
![Figure 3 is updated](data/images/fig3_update.avif){width=100%}

![Table 1 is unaltered](data/images/tab1_update.png){width=100%}
![Table 1 is unaltered](data/images/tab1_update.avif){width=100%}

![Table 2 is updated](data/images/tab2_update.png){width=100%}
![Table 2 is updated](data/images/tab2_update.avif){width=100%}

![Table 3 is unaltered](data/images/tab3_update.png){width=100%}
![Table 3 is unaltered](data/images/tab3_update.avif){width=100%}

```{r, include = FALSE}
unlink(file.path(here::here(), "vignettes", ".venv"), recursive = TRUE)
Expand Down

0 comments on commit 8fe4fb2

Please sign in to comment.