Skip to content

Instantly share code, notes, and snippets.

@fmichonneau
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fmichonneau/f768c987414e2107f7be to your computer and use it in GitHub Desktop.
Save fmichonneau/f768c987414e2107f7be to your computer and use it in GitHub Desktop.
RSC applicants template
library(whisker)
library(knitr)
responses <- read.csv(file="applicants.csv", stringsAsFactors=FALSE)
names(responses)[ncol(responses)] <- "attendance"
responses_lst <- apply(responses, 1, function(x) as.list(x))
template <- "
--------------------
# {{Name}}
* Title: {{Title}}
* Institution: {{Institutional.affiliation}}
* Email: {{email.address}}
* Applied on: {{Timestamp}}
## Experience:
{{Describe.your.experience.with.reproducible.science}}
## What motivates you?
{{What.motivates.you.to.attend.this.workshop.}}
## What do you expect to contribute?
{{What.do.you.expect.to.contribute.to.the.event.}}
## Interests and relevant work
{{Interests.and.relevant.work}}
## Demographic information
* Gender: {{Gender}}
* Ethnicity: {{Ethnicity}}
* Race: {{Race}}
* Citizenship: {{Citizenship}}
## Funding and attendance
* {{Funding}}
* {{attendance}}
"
text <- lapply(responses_lst, function(x) whisker.render(template, x, strict=FALSE))
cat(unlist(text), sep="\n", file="applications.Rmd")
knit2html("applications.Rmd")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment