rreportersofficer

R ReporterRs Package - Add text after bookmark


I'm creating a tool to automatically generate reports for people in the office using the ReporteRs package in R. We have a standard set of tables/graphs, but the number of times a single table or graph may appear will vary from person to person. Due to this, I cannot make a single template with a fixed number of bookmarks.

I was hoping to get around this by having a bookmark on the first figure title and then repeatedly adding figure titles and graphs/tables underneath that one bookmark.

The 'addParagraph' function will only replace the bookmarked paragraph, so it will not work. I also tried replacing the bookmarked paragraph with a set of paragraphs, but since I have to alternate text/tables the bookmark gets placed onto two paragraphs after the first iteration and does not work after that.

Is there any way to simply add a piece of text after a bookmarked paragraph?


Solution

  • No that's not possible with ReporteRs. Maybe you could use package officer instead, cursor_* functions would help you.