Skip to content

Instantly share code, notes, and snippets.

@hlapp
Forked from fmichonneau/RSC_applicants.R
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlapp/41312b3cc788abcea263 to your computer and use it in GitHub Desktop.
Save hlapp/41312b3cc788abcea263 to your computer and use it in GitHub Desktop.
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 <- "
--------------------
# {{{YourName}}}
* Institution: {{{Affiliation}}}
* Email: {{{EmailAddress}}}
* Applied on: {{{Timestamp}}}
## What skills and knowledge do you bring to the event?
{{{Whatskillsandknowledgedoyoubringtotheevent}}}
## What motivates you to participate in the event?
{{{Whatmotivatesyoutoparticipateintheevent}}}
## What do you hope to get out of the event?
{{{Whatdoyouhopetogetoutoftheevent}}}
## Other comments
{{{OtherComments}}}
## Demographic information
* Gender: {{{Gender}}}
* Ethnicity: {{{Ethnicity}}}
* Ethnic Origin/Race: {{{RaceEthnicorigin}}}
## Funding and attendance
* {{{Doyouhavefundstosupportyourparticipation}}}
* I will be traveling from {{{Wherewillyoulikelybetravelingfrom}}}.
* {{{Availability}}}
"
text <- lapply(responses_lst, function(x) whisker.render(template, x))
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