Sharing Markdown Reports (without Github)

  • Sharing Markdown Reports (without Github)

     David updated 1 week, 1 day ago 2 Members · 4 Posts
  • peter.bonner

    Member
    October 13, 2020 at 6:02 am

    Hi David,

    I wanted to get your opinion on the sharing of reports made in Markdown. Formatting for PDF can be tricky and I’m sure there are more creative ways to share documents (however in my line of work PDFs are still the dominant medium). Is there a way to share HTML reports without using Github? And if not is the Pagedown package the most suitable for creating a PDF report? (I know you also mentioned Xaringan in your course but wasn’t sure if this package was purely for presentations or could be used for PDFs as well).

    Peter

  • David

    Organizer
    October 13, 2020 at 7:11 am

    Great questions!

    The first thing I make sure people know is that you can just email HTML documents (i.e. just add them as attachments to Gmail, Outlook or whatever email client you use). Sorry if this is totally obvious to you, but I’ve come across enough people who don’t know this, which is why I mention it.

    Another thing I’ve done is used the gmailr package to email knitted HTML reports directly from RStudio. One time I got really fancy and set it up using GitHub actions so that it emailed my client an automatically generated report every day at 7:00am. If this kind of thing would be interesting to learn about, I can cover it in a future office hours session.

    You’re right that formatting PDFs is really tricky. The pagedown package is the best option, I think, unless you know LaTeX and want to go that route. One idea you might consider, though, is using the chrome_print() function from pagedown. You give it an HTML document and it converts it to PDF. In this way, you can knit to HTML first, do styling that way, and then convert it to PDF. You might end up with weirdly sized PDFs (i.e. not 8.5×11 or A4 or whatever), but if that doesn’t matter to you, it’s an option.

    And yes, you can totally use the xaringan package to make PDFs. It just happens to be the case that the PDFs it creates are sized like slides, but, again, if that doesn’t matter, go for it!

    Let me know if you have other questions! This kind of stuff is my favorite part of R. 🙂

  • peter.bonner

    Member
    October 13, 2020 at 10:37 am

    That’s great thank you.

    No I didn’t know you could email HTML, this will save me ALOT of time and hassle! I’ll definitely check out the gmailr package and play around with xaringan when I have some time. I think an office hour looking at the gmailr package would be really useful.

  • David

    Organizer
    October 13, 2020 at 8:18 pm

    Awesome! Glad that’s helpful. I’ll add the gmailr package to my list of potential office hours topics. Another option for emailing from R is the blastula package.

Log in to reply.

Original Post
0 of 0 posts June 2018
Now
The R for the Rest of Us community is live! Join regular office hours, ask questions in the forum, and more!