Last active
August 29, 2015 14:03
-
-
Save cannin/adea2b2c9d2ed94886dc to your computer and use it in GitHub Desktop.
Convert R vector into a call object and then convert the "call" object to a character string; this was useful for converting a vector back into code when generating knitr reports using brew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert R vector into a call object and then convert the "call" object to a character string | |
# This was useful for converting a vector back into code when generating knitr reports using brew | |
tmp <- c("A", "B", "C") | |
deparse(do.call(call, as.list(c("c", tmp)))) | |
# [1] "c(\"A\", \"B\", \"C\")" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment