co-analysis / a11ytables

R package: generate best-practice stats spreadsheets for publication
https://co-analysis.github.io/a11ytables/
Other
42 stars 3 forks source link

Allow inclusion of images/graphs #101

Open fingertipsy opened 11 months ago

fingertipsy commented 11 months ago

would it be possible to have sheet_type = image or sheet_type = graph and pass .svg images or ggobjects to be displayed on the worksheet?

matt-dray commented 11 months ago

Hi, thanks for the question.

You may be aware that this package is built to support the 'Releasing statistics in spreadsheets' guidance by the Government Analysis Function. Regarding images, the guidance says:

Images within spreadsheets should be avoided. Generally the best place for any analysis or data visualisations is in HTML.

Similarly, the 'Accessible spreadsheets: a checklist of the basics' page says:

11. Avoid images in spreadsheets Images should be avoided as they can disrupt navigation. If you cannot avoid including images, make sure all logos, graphics, charts and any other images within the spreadsheet document have alternative text attached to them.

For these reasons, {a11ytables} currently doesn't support image insertion.

You could, however, insert a new sheet to the Workbook-class object generated by a11ytables::generate_workbook() and use the openxlsx::insertImage() function to insert an image.