Skip to content

Commit

Permalink
code is now outputed as is in the Rmd
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinFay committed Mar 6, 2018
1 parent b0b6ed3 commit 3d8072f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/knitr_engine.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ set_neo4j_engine <- function(neo4j_home,

knit_engines$set(neo4j = function(options) {
if (options$eval) {
options$code <- clean_input(options$code)
options$code_to_eval <- clean_input(options$code)
out <- encypher_for_knitr(options)
#out <- options$code
}
Expand Down
8 changes: 4 additions & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ encypher_for_knitr <- function(options){
# Sequencially send the code if multiple calls are given (for windows compatibility)

if (is.null(options$neo4j_passwd)){
for (i in seq_along(options$code)){
for (i in seq_along(options$code_to_eval)){
write(
system(
glue("{options$cypher_bin} -a {options$neo4j_adress} --format {options$neo4j_format} {shQuote(options$code[[i]])}"),
glue("{options$cypher_bin} -a {options$neo4j_adress} --format {options$neo4j_format} {shQuote(options$code_to_eval[[i]])}"),
intern = TRUE),
file = t,
append = TRUE
)
}
} else {
for (i in seq_along(options$code)){
for (i in seq_along(options$code_to_eval)){
write(
system(
glue("{options$cypher_bin} -a {options$neo4j_adress} -u {options$neo4j_user} -p {options$neo4j_passwd} --format {options$neo4j_format} {shQuote(options$code[[i]])}"),
glue("{options$cypher_bin} -a {options$neo4j_adress} -u {options$neo4j_user} -p {options$neo4j_passwd} --format {options$neo4j_format} {shQuote(options$code_to_eval[[i]])}"),
intern = TRUE),
file = t,
append = TRUE
Expand Down

0 comments on commit 3d8072f

Please sign in to comment.