Skip to content
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

Merged
merged 23 commits into from Feb 23, 2020
Merged

More pandoc #1

merged 23 commits into from Feb 23, 2020

Conversation

christophsax
Copy link
Member

No description provided.

@christophsax christophsax merged commit 1fa5e36 into master Feb 23, 2020
@christophsax christophsax deleted the more-pandoc branch February 23, 2020 22:18
DESCRIPTION Show resolved Hide resolved
Title: Individual RMardown Templates
Version: 0.0.1
Maintainer: Christoph Sax <christoph@cynkra.com>
Description: Easy Generation of Individual RMardown Templates
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe:

Suggested change
unlist(strsplit(paste("--variable", vars, sep = "Fwh0VauLpwa7"), split = "Fwh0VauLpwa7", fixed = TRUE))
paste(paste0("--variable ", vars), collapse = " ")

Copy link
Member Author

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.

Copy link
Collaborator

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))
}

Copy link
Member Author

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)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants