0

On my way to becoming a datajournalist, I have come across lots of fantastic tools, such as R and Rmarkdown. Now that I work for a proper newspaper, I realize that most of the time, I end up using MS Excel (which, I don't deny, is also a great tool) and a concatenate function that I paste in an HTML file. I am losing quite a lot of my R knowledge and practice, and that's sad.

I know that I will soon be faced with a task that I would like to use as a way to get back to R and Rmarkdown.

I have some html pages working just fine and I'd like to change the data that is presented in them using Rmd.

My question is : is there a package or a way to combine into one Rmarkdown file most of an HTML page (header, css and javascript files and analytics, footer), and some Rmarkdown chunks ?

Thanks a lot for your answer.

2 Answers 2

1

Maybe you could try something like this (http://rmarkdown.rstudio.com/html_document_format.html#includes):

---
title: "Habits"
output:
  html_document:
    includes:
      in_header: header.html
      before_body: doc_prefix.html
      after_body: doc_suffix.html
---

This would allow the combination of html and Rmd in general. Furthermore there is the chunk option child, which would allow to use Rmd files as chunk content?

Sign up to request clarification or add additional context in comments.

Comments

1

You can use .css files to style your Rmakdown. In the header you do something like:

---
title: "Habits"
output:
html_document:
  css: styles.css
---

see this

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.