From 3d8072fc6bb664f925b23e5157783b4bf1e92415 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 6 Mar 2018 22:12:10 +0100 Subject: [PATCH] code is now outputed as is in the Rmd --- R/knitr_engine.R | 2 +- R/utils.R | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/knitr_engine.R b/R/knitr_engine.R index 31c5d24..ab045a1 100644 --- a/R/knitr_engine.R +++ b/R/knitr_engine.R @@ -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 } diff --git a/R/utils.R b/R/utils.R index c7ebf70..53f2993 100644 --- a/R/utils.R +++ b/R/utils.R @@ -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