Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ccwriter <- function(t){
primary <- c(
t[['primary.presenter']],
t[['primary.presenter.org']],
t[['primary.presenter.email']],
t[['primary.presenter.url1']],
t[['primary.presenter.url2']],
t[['primary.presenter.url3']],
t[['primary.presenter.country']],
t[['primary.presenter.region']]
)
second <-
c(
t[['second.presenter']],
t[['second.presenter.email']],
t[['second.presenter.region']],
t[['second.presenter.country']]
)
third <- c(
t[['third.presenter']],
t[['third.presenter.email']],
t[['third.presenter.region']],
t[['third.presenter.country']]
)
fourth <- c(
t[['fourth.presenter']],
t[['fourth.presenter.email']],
t[['fourth.presenter.region']],
t[['fourth.presenter.country']]
)
fifth <- c(
t[['fifth.presenter']],
t[['fifth.presenter.email']],
t[['fifth.presenter.region']],
t[['fifth.presenter.country']]
)
presenters <- vector()
presenters[['primary']] <- paste("* ", paste(primary, collapse = " / "))
presenters[['second']] <- paste("* ", paste(second, collapse = " / "))
presenters[['third']] <- paste("* ", paste(third, collapse = " / "))
presenters[['fourth']] <- paste("* ", paste(fourth, collapse = " / "))
presenters[['fifth']] <- paste("* ", paste(fifth, collapse = " / "))
presenterstext <- paste(presenters, collapse = "<br>")
presenterstext <- gsub("/\\s+/", "", presenterstext)
presenterstext <- gsub("* /", "", presenterstext)
presenterstext <- gsub("\\*\\s*$", "", presenterstext)
presenterstext <- gsub("\\*\\s*<br>+$", "<br>", presenterstext)
all.tracks <- gsub("(\\, )+$", "", paste(c(t[['track.1']], t[['track.2']], t[['track.3']], t[['track.4']]), collapse = ", "))
final.text <- paste(
"# <div id=\\"", t[['number']], "\\">", t[['session.title']], "</div><br>",
"**Description** ", t[['session.description']], "<br>",
"## Presenter(s) <br>",
presenterstext,
"<br>## Logistics <br>",
"* **Level of comfort with presenting in English:** ", t[['english.comfort']], "<br>",
"* **Language of choice:** ", t[['translation.language']], "<br>",
"* **Tracks:** ", all.tracks, "<br>",
"* **Topic:** ", t[['topic']], "<br>",
"* **Format:** ", t[['format']], "<br>",
"* **Time:** ", t[['time']], "<br>",
"* **Number of participants:** ", t[['how.many.people']], "<br>",
"* **How does proposal incorporate voices from diverse backgrounds and/or different global communities?** ", t[['session.diversity']], "<br>",
"* **Session outcome:** ", t[['session.goals']], "<br>",
"* **Longer description:** ", t[['session.longer.description']], "<br>",
"* **Applied for scholarship:** ", t[['scholarship']], "<br>",
"* **Is your ability to present completely dependent on the result of the scholarship?** ", t[['ability.present']], "<br>",
"* **How did you hear about the 2019 Global Summit?** ", t[['how.did.you.hear']], "<br>",
"* **In what ways are you involved in Creative Commons or the open movement? Check all that apply** ", t[['how.involved']], "<br>",
"* **How long have you been connected with the Creative Commons movement?** ", t[['how.connected.cc']], "<br>",
"* **What topics are you interested in? Check all that apply** ", t[['topics.interested']], "<br><br><br>******"
)
write(final.text,file="result.txt",append=TRUE)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.