From a6147cb40c8f6d3fedece72ae16f5552e9dbb6be Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Thu, 28 Sep 2023 13:14:22 +0200 Subject: [PATCH 1/3] Modifying `opts_current` with `set` method requires to manually unlock The object is locked since 1.44 and it errors since then. Fix #209 --- R/RMarkdown.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/RMarkdown.R b/R/RMarkdown.R index 75ff41d..005776a 100644 --- a/R/RMarkdown.R +++ b/R/RMarkdown.R @@ -55,7 +55,12 @@ begin_plot <- function(){ ## This function is used by Julia plot_display function finish_plot <- function(){ + ## FIXME: opts_current is supposed to be read-only + ## so it require unlock to be modified since knitr 1.44 + ## https://yihui.org/en/2023/09/knitr-1-44/ + knitr::opts_current$lock(FALSE) knitr::opts_current$set(Jfig.cur = .julia$pending_plot_number + 1L) + knitr::opts_current$lock(TRUE) julia$current_plot <- .julia$pending_plot } From 68f0e3c4d0006599b854ae09250c6aadd243f573 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Thu, 28 Sep 2023 13:16:02 +0200 Subject: [PATCH 2/3] Add NEWS --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 188ce30..fa41695 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# JuliaCall 0.17.5.9000 + +* Fix breakage with **knitr** 1.44 when using Plots in a `julia` chunk ([#209](https://github.com/Non-Contradiction/JuliaCall/issues/209)). + # JuliaCall 0.17.5 * Nineteenth release on CRAN. From 3a791f3fc41a5ed6a3ce33cba8e327cf6dd642dc Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Thu, 28 Sep 2023 13:17:27 +0200 Subject: [PATCH 3/3] bump to dev version to follow NEWS item --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index a928067..1cc16fb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: JuliaCall Type: Package Title: Seamless Integration Between R and 'Julia' -Version: 0.17.5 +Version: 0.17.5.9000 Date: 2022-09-08 Authors@R: c( person("Changcheng", "Li", , "cxl508@psu.edu", c("aut", "cre")),