New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More pandoc #1
More pandoc #1
Conversation
Title: Individual RMardown Templates | ||
Version: 0.0.1 | ||
Maintainer: Christoph Sax <christoph@cynkra.com> | ||
Description: Easy Generation of Individual RMardown Templates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description: Easy Generation of Individual RMardown Templates | |
Description: Easy Generation of Customized RMarkdown Templates. |
vars <- paste0(names(list),":",unlist(list)) | ||
|
||
# zip in '--variable' before each element, use unlikely temp separator string | ||
unlist(strsplit(paste("--variable", vars, sep = "Fwh0VauLpwa7"), split = "Fwh0VauLpwa7", fixed = TRUE)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe:
unlist(strsplit(paste("--variable", vars, sep = "Fwh0VauLpwa7"), split = "Fwh0VauLpwa7", fixed = TRUE)) | |
paste(paste0("--variable ", vars), collapse = " ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The arguments need to be separated. Having them on one line does not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zip <- function(x, y) {
x <- rep_len(x, length(y))
m <- matrix(c(x, y), ncol = 2)
as.vector(t(m))
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works. And with a tweak:
zip <- function(x, y) {
x <- rep_len(x, length(y))
m <- matrix(c(x, y), nrow = 2, byrow = TRUE)
as.vector(m)
}
x <- "--variable"
y <- letters[1:5]
zip(x, y)
No description provided.