0

I am brand new to markdown language.

I am using bookdown to generate reports. I have two questions:

If I have one stacked dataset with one column being a factor...

  1. Is it possible to run separate reports by each factor level (note: I know how to do this analysis in R, I want to know if I can export separate results by each factor as separate reports. Any tips to do this are appreciated.

  2. Can you reference this level in the TEXT section of the report?

I want one report titled, "Results for A" with stats=1234 and another report titled "Results for B with stats=567" where A and B are the levels of a factor.

Does that make sense? All help is appreciated. I want one report titled, "Results for A" with mode = 2 and another report titled "Results for B with mode = 3".

Does that make sense? All help is appreciated.

user1638567
  • 69
  • 2
  • 5
  • @Samuel Unless you see a question that is obviously not a valid question, I'd not recommend pushing people to community.rstudio.com. My opinions here: https://community.rstudio.com/t/choosing-between-this-site-and-stackoverflow-for-posting-a-question/1151/36?u=yihui I'm okay with users asking questions on either sites, but I'd not push them to one way or the other. – Yihui Xie Sep 29 '17 at 16:22

1 Answers1

1

You can pass a parameter to the report. The parameter has to be defined in the yaml header Example:

in example.rmd:

---
output: html_document
params:
  stats: NA # default value
---
Results for stats = `r params$stats`

And pass the parameter as such:

rmarkdown::render("example.rmd", params = list(stats = 123))
nobits
  • 66
  • 4